• 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

Add Custom Class to Genesis Featured Post 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 › General Discussion › Add Custom Class to Genesis Featured Post Image

This topic is: not resolved
  • This topic has 4 replies, 2 voices, and was last updated 10 years, 3 months ago by Victor Font.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • August 22, 2015 at 8:23 am #163141
    Victor Font
    Moderator

    A commenter on my site asked how to add a custom css class to the Genesis Featured Post image. This can be accomplished easily with jQuery. Since someone asked for this, I thought it might be useful for many: http://victorfont.com/addclass-genesis-featured-post-image/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    August 22, 2015 at 9:11 am #163142
    Genesis Developer
    Member

    If you are using Genesis 2.1.3 beta then you can try this:

    add_filter( 'genesis_attr_entry-image-widget', 'gd_add_custom_class_fp' );
    function gd_add_custom_class_fp( $attr ) {
       $attr['class'] = 'my-own-class';
    
      return $attr;
    }

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

    August 22, 2015 at 9:29 am #163143
    Genesis Developer
    Member

    Sorry! version will be Genesis 2.2.0-beta1


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

    August 22, 2015 at 9:37 am #163145
    Genesis Developer
    Member

    I also tested the following code in Genesis Version: 2.1.2 ยท Released: July 15, 2014

    
    add_filter( 'genesis_attr_entry-image-widget', 'gd_add_custom_class_fp' );
    function gd_add_custom_class_fp( $attr ) {
      $attr['class'].= ' my-own-class';
      return $attr;
    }  

    It is working for me.


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

    August 22, 2015 at 10:51 am #163150
    Victor Font
    Moderator

    The hook will add the extra class to any entry-image in any type of widget on the page. The original question on my site asks how to add the extra class to featured post images only. You can't filter the hook by widget type.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ 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