Modify the post/entry wrapper markup in genesis childtheme [closed]

Today I had a similar issue and this worked for me:

/**
 * Add and extra class to the entry-content div
 *
 */
function vdl_entry_content_extraclass( $attributes ) {
  $attributes['class'] = $attributes['class']. ' my-custom-class';
    return $attributes;
}
add_filter( 'genesis_attr_entry-content', 'vdl_entry_content_extraclass' );

In my case, I am adding this code to my single-portfolio.php template because I only want to add that class in that template. If you paste this code in functions.php the change will apply all templates. You could also use conditional tags inside the function to decide where to apply this change.

As I only started this week with Genesis, and this is my first child theme, I don´t know if this is the right way to do it, but I hope it will help you.

Leave a Comment