Add Class To Genesis Archive Excerpts Only If Manual Excerpt Is Added

This code adds a custom class to the manual excerpt when excerpts selected using the Genesis > Theme Settings > Content Archives > Display > Entry Excerpts and manually added in the Excerpt meta box as seen in the following example :

When you add content in this box and use the Entry Excerpts setting, you’ll find the output look like this when you inspect the HTML element :

The above excerpt is wrapped in a custom class.

If the content is not added in this box, no custom class is added to the_excerpt as you can see in the HTML output :

This code enables you to conditionally modify the excerpts on archive pages in Genesis.

Login or register to access the code snippet :

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.