• Resolved John

    (@dsl225)


    Hi again,

    Is there a way to make featured images clickable so that they are able to display in lightbox, same as the inline images?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @dsl225,

    You would probably need to add some custom markup to the images in a child theme to make them compatible with the plugin you’re using for lightboxes. The plugin documentation probably has information about the changes required.

    — Anders

    Thread Starter John

    (@dsl225)

    Thanks Anders for that but I realize my message was misleading:

    My question is not related to lightbox at all… I’m using a plugin for that but the question is basically about how to make a featured image clickable in order to get it linked to the media file, like it is possible for all other inline images.
    I’m already using child theme anyhow.

    Sorry for the confusion here.

    Theme Author Anders Norén

    (@anlino)

    Hi @dsl225 ,

    Ah, no worries. You’ll need to copy the single.php file to your child theme, and change the last occurrence of:

    <div class="featured-media">

    to:

    <a href="<?php the_post_thumbnail_url(); ?>" class="featured-media">

    …and change the last occurrence of

    </div><!-- .featured-media -->

    to:

    </a><!-- .featured-media -->

    That should do it.

    — anders

    Thread Starter John

    (@dsl225)

    Works great, many thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Feature images clickable?’ is closed to new replies.