• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Linking featured image to Large image

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Linking featured image to Large image

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 13 years, 6 months ago by Morten.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • February 4, 2013 at 3:12 pm #18004
    Morten
    Member

    I'm using the Generate theme, and I trying to make the featured image link to a large version of the image instead of the post itself, but only on single posts.
    I can make part of this happen (probably not the right way though) by changing "Get_permalink()" to "$image_lightbox" and adding the following to function.php
    "if ( $image_lightbox = genesis_get_image( array( 'format' => 'url', 'size' => ( 'large' ) ) ) ) "
    The problem is that this also changes the link on the blog/archive pages. I tried messing around with "if ( is_single" )" but can't get it to work
    Can anyone help me or point me in the right direction
    Thanks
    Morten

    February 4, 2013 at 5:27 pm #18082
    SoZo
    Member

    What is the full function you're using? How did you add in the conditional tag?


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    February 5, 2013 at 8:09 am #18199
    Morten
    Member

    I just changed the existing code a little, added the bolded line and changed the get_permalink()

     

    /** Add custom post image above post title */
    add_action( 'genesis_before_post_content', 'generate_post_image', 5 );
    function generate_post_image() {

    if ( is_page() || ! genesis_get_option( 'content_archive_thumbnail' ) )
    return;
    if ( $image_lightbox = genesis_get_image( array( 'format' => 'url', 'size' => ( 'large' ) ) ) )

    if ( $image = genesis_get_image( array( 'format' => 'url', 'size' => genesis_get_option( 'image_size' ) ) ) ) {
    printf( '<a href="%s" rel="bookmark"><img class="post-image" src="%s" alt="%s" /></a>', $image_lightbox, $image, the_title_attribute( 'echo=0' ) );
    }

    }

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble