• 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

Remove featured image link

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 › Remove featured image link

This topic is: not resolved

Tagged: featured image, link

  • This topic has 7 replies, 4 voices, and was last updated 10 years, 10 months ago by jstone98.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • August 14, 2014 at 3:19 pm #118860
    BlueNinja
    Member

    Hello Guys,

    I am using beautiful-pro theme for website http://www.mindfitcoaching.co.uk/

    I have added this code to enable featured image

    add_action( 'genesis_entry_header', 'single_post_featured_image', 15 );
    
    function single_post_featured_image() {
    	
    	if ( ! is_singular( 'post' ) )
    		return;
    	
    	$img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) );
    	printf(  '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img );
    	
    }

    This works great and allows me to click on image from home page through to blog page - but the image still has a hyperlink (to same page) once I have clicked through ???

    Example here http://www.mindfitcoaching.co.uk/the-elephant-and-the-chain/

    http://www.mindfitcoaching.co.uk
    August 14, 2014 at 3:20 pm #118861
    BlueNinja
    Member

    Sorry clicked too soon!!

    So Ideally I would like to remove the hyper-link once clicked into the individual blog post.

    Kind Regards

    James 🙂

    August 18, 2014 at 3:15 am #119495
    cazwilson
    Member

    Hi @BlueNinja.

    You've solved my issue of adding a feature image to a page...thanks!

    I thought simply removing the <a> tags would solve the link problem, but it was just leaving a line of script on the page for me.

    This is a bit of a hack, but I added style="cursor:default;" to the tag so the cursor doesn't change when you rollover the image (so you don't think it's a link).

    So you have: <a href="%s" title="%s" style="cursor:default;">%s</a>

    It works for me. I hope it does for you. 🙂

    CW

    August 18, 2014 at 3:16 am #119496
    cazwilson
    Member

    Damn, I'll try again:
    <a href="%s" title="%s" style="cursor:default;">%s</a>

    lol

    August 18, 2014 at 3:19 am #119499
    BlueNinja
    Member

    Hey @cazwilson

    Awesome thanks for the reply - I will add this to my code too.

    If anyone can suggest another way then please feel free to let us know

    Kind Regards

    James

    August 18, 2014 at 6:10 am #119508
    Genesis Developer
    Member

    Replace your code by this

    add_action( 'genesis_entry_header', 'single_post_featured_image', 15 );
    function single_post_featured_image() {
    	
    	if ( ! is_singular( 'post' ) )
    		return;
    	
    	$img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) );
    	printf(  '%s',  $img );
    	
    }

    This will remove the hyperlink from single post details page.


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 18, 2014 at 6:14 am #119509
    BlueNinja
    Member

    Thank for the reply @genwrock 🙂

    January 20, 2015 at 3:43 pm #138131
    jstone98
    Participant

    Hi @genwrock,

    I tried your code (using Genesis Sample theme) I still get a link on my featured image displayed on the post. Something like this:

    Is there something in Genesis itself that is causing this to happen?

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 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

© 2025 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