make home block text clickable

Support Area Forums Selfie make home block text clickable

Viewing 7 posts - 1 through 7 (of 7 total)
URL to the page in question: http://www.vilhelmstokstad.com
  • Author
    Posts
  • #21253
    vilhelm stokstad
    Participant

    Hi,

    Is there a way to make the titels and text on the home blocks do the same thing as the little button in the corner; open a slideshow? I think this would make the site a lot more user friendly, especially on mobile.

    Thanks

    #21260
    Bill Robbins
    Moderator

    Hello Vilhelm,

    Good question there. You can set the text in the home block to open up the gallery lightbox. Here’s how:

    1. Go to the Appearance section in your WordPress dashboard and choose Edit.
    2. From the list of files on your right, choose page-home-template.php
    3. Find this spot:
      
      <?php echo apply_filters('the_content', get_post_meta($post->ID, 'hero_content', true)); ?>
      
    4. Change that line to this:


      (Be sure to copy that code directly from the support site and not the notification email).

    5. Save your changes.

    That will turn all the text in your home blocks into a link that will open up your galleries. The only catch is you won’t be able to place links inside your text anymore.

    If you have any questions or trouble, let me know.

    Thanks,
    Bill

    #21262
    vilhelm stokstad
    Participant

    Works like a charm, thanks! Is it possible to exclude a single home block from this? or is that a hassle?

    #21263
    vilhelm stokstad
    Participant

    Also this doesn’t seem to work when i am viewing just the blocks in a portfolio category, it only affects the absolute homepage.

    thanks again!

    #21276
    Bill Robbins
    Moderator

    Vilhelm,

    I’m glad that worked out. You can add it to the categories too by making the same edit to the taxonomy-portfolio-group.php file too. That will bring the change there as well.

    Practically removing the link from a specific one would be a bit of trouble. You could use a conditional statement if you want to give it a shot. It would change the snippet above to something like this:

    (Again copy that code directly from the support site and not the notification email)

    You’ll want to change the first line there where it says Block Name to the name (title) of the block you’d like to keep from being clickable and that should exclude it.

    If you run into trouble, let me know.

    Thanks,
    Bill

    #21282
    vilhelm stokstad
    Participant

    Hi Bill,

    I didn’t get the last piece to work, it seems to still affect all of the home blocks, so that none of the links work instead. quick solve: made the first block an image with text instead of actual text.

    Another thing, the first peace of code, that makes the text clickable, seems to affect the actual slideshow. The first image shows twice when I’m using the text link, but not when using the “+”-button.

    Sorry for the hassle! Thanks for all the help, really appreciate it!
    Regards Vilhelm

    #21291
    Bill Robbins
    Moderator

    Vilhelm,

    It most likely will show the first one twice. We’re creating a new link to open up the slideshow and it’s adding that link to the loop of the gallery. There may not be a way around that. Sorry about that.

    Bill

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘make home block text clickable’ is closed to new replies.