[Resolved] Blog archive page: featured images linking

Home Forums Support Blog archive page: featured images linking

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1376408
    ch1800

    Hi folks,

    Blog archive page: Is there a way to link the post’s featured image + the page title to the media (lightbox) instead of the corresponding blog page?

    PS: I’m already using this for randomizing them.

    Thanks and happy Sunday!

    #1377018
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You’d have to set up the lightbox part, but you may be able to filter the link of the featured image/title like this:

    add_filter( 'post_link', function( $link ) {
        if ( ! is_singular() && has_post_thumbnail() ) {
            return get_the_post_thumbnail_url();
        }
    
        return $link;
    } );

    Let me know 🙂

    #1377361
    ch1800

    Excellent, works like a charm!
    Many thanks for this and the previous one for randomizing them that I also found here.

    I use those for creating a design portfolio, simply by using GP’s masonry layout for posts archives. No need of another plugin. Featured images are design screenshots in full height and details & links to the websites are in the excerpts.

    #1378206
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.