• 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

Disable link and alt on the icons Post Formats

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 › Disable link and alt on the icons Post Formats

This topic is: resolved

Tagged: Post Formats

  • This topic has 3 replies, 2 voices, and was last updated 12 years, 4 months ago by rfmeier.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • June 6, 2014 at 12:33 am #108284
    macrunner
    Participant

    In Genesis Sample I am using Post Formats, I followed this guide: http://my.studiopress.com/snippets/post-formats/

    you can disable the URL link and ALT info on icon? In practice, I would like to display only the icon, without link and alt.

    I found this snippet of code in the file themes/genesis/lib/structure/post.php

    //* Get post format
    	$post_format = get_post_format();
    
    	//* If post format is set, look for post format image
    	if ( $post_format && file_exists( sprintf( '%s/images/post-formats/%s.png', CHILD_DIR, $post_format ) ) )
    		printf( '<a href="%s" title="%s" rel="bookmark"><img src="%s" class="post-format-image" alt="%s" /></a>', get_permalink(), the_title_attribute( 'echo=0' ), sprintf( '%s/images/post-formats/%s.png', CHILD_URL, $post_format ), $post_format );
    
    	//* Else, look for the default post format image
    	elseif ( file_exists( sprintf( '%s/images/post-formats/default.png', CHILD_DIR ) ) )
    		printf( '<a href="%s" title="%s" rel="bookmark"><img src="%s/images/post-formats/default.png" class="post-format-image" alt="%s" /></a>', get_permalink(), the_title_attribute( 'echo=0' ), CHILD_URL, 'post' );
    
    }
    

    I did a lot of attempts but I can not disable links and alt.
    But I do not want to touch the core of Genesis. Maybe you can use a hook in the child theme?

    Thanks for any help

    June 6, 2014 at 9:32 am #108316
    rfmeier
    Member

    Hello,

    Since there is not a filter or action within the Genesis core callback, the default callback will have to be removed and a new custom callback will have to be attached in it's place. Try the code below;

    https://gist.github.com/rfmeier/8cbe9895612a9dff5a95


    Ryan Meier – Twitter

    June 6, 2014 at 1:14 pm #108365
    macrunner
    Participant

    Hi Ryan,

    I used the code, it works wonderfully 😉

    Thank you very much

    June 6, 2014 at 1:46 pm #108369
    rfmeier
    Member

    You are welcome. I am glad I could help.


    Ryan Meier – Twitter

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