Gallery Post Format: Link with File (2 posts)

  1. ccpowered
    Posted 2 years ago #

    Hey Caroline,

    I am very happy with your theme, but now I am wondering, how to change the linking with your gallery template.
    The featured images are shown correctly, but when I click on them I am redirected to a new page, which displays the picture.

    Is there a way to link directly to the file? I'd like to use a lightbox plugin with this feature...


  2. Caroline Moore
    Theme Author

    Posted 2 years ago #

    Hi! Since the gallery in the Gallery post format uses specific settings, you can override them by copying the content-gallery.php template file into a child theme. Change the do_shortcode() function on line 11 to include the gallery features you want -- for example, to link to the image (instead of the attachment page) you'd add this to the shortcode syntax:


    Read more about the shortcode and how to use it here:

    As to how to get it to work with a Lightbox plugin, that's up to the plugin and how it handles WordPress galleries.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic