• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2966

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Subscriptions
  • Access
  • Log in

Add Custom CSS Class To Featured Image In Genesis Featured Posts Widget

This solution enables you to add a custom class to the default class included in the featured image output using the Genesis featured posts widget.

The code enables you to add the class via the safety of any Genesis child theme without modifying the code in Genesis.

In the following example, a class named added-class has been added as you can see in the HTML output :

Code Installation

Add the PHP code from the download folder to the end of your child themes functions file.

Then you can target the featured image like this :

.home-top .featuredpost .added-class {
    border: 5px #F65D52 solid;
}

Register or login to access the download folder :

Register for full access

Related Tutorials

  • Modify Genesis Featured Posts Widget

Genesis Featured Posts

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Code written by Brad Dalton specialist for Genesis & WooCommerce.

Advertise · WPEngine · Genesis · Log in

  • Account
  • Consulting
  • Post Tags
  • Contact
  • Terms
  • Monthly Membership
  • Yearly Subscriptions
  • Log in
 

Loading Comments...