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.
Related Posts:
- Override admin selected page layout
- remove_action conditionally for Custom Post Type – not working
- How do filters and hooks really work in PHP
- Trouble understanding apply_filters()
- How would one modify the filtering Gutenberg applies to pasted content?
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- How to add a custom CSS class to core blocks in Gutenberg editor?
- Filter translations (gettext strings) on specific admin pages
- Is it possible to use object in add_action?
- Filter hook before create order WooCommerce
- Add Class to Specific Paragraph of the_content()
- add_filter for specific pages
- apply_filters() slices away needed arguments
- How to add attribute to output with wp_video_shortcode add_filter
- add class to term_description
- How may I filter get_users() similarly to pre_get_posts?
- remove other tabs in new wordpress media gallery
- wp_title() empty on a static front page
- How can I register a new REST context?
- How can I add a fifth option to the alignment picker?
- Customize WooCommerce Error Message
- How to stop WordPress from changing ellipsis into a pre-composed triple-dot glyph?
- Dump contents of a variable inside a filter/hook callback that runs during save post
- Customize user account activation message
- Conditionally call add_action depending on post_type?
- Right way to add HTML bloginfo name using a filter
- Allow users to exclude categories? (WP 3.1.2)
- Allow EPS file upload – two EPS files have different MIME types
- How to call a function or method that is Namespaced using another plugin
- How to change currency programmatically on creating order action?
- Applying custom filter instead of the_content doesn’t render embeds
- Change username before login
- De-bloating the page classes
- Replace a word with a word in the URL string
- Redirect to checkout woocommerce failed
- wp_insert_post_data filter hook identify current action
- Add Class to a div using a filter?
- Remove Actions added by SEO ultimate Plugin
- Modifying a CoBlocks Filter in Functions
- Shortcodes — Using add_action, add_filter in the shortcode
- How to link the whole list item in Gutenberg’s latest posts block?
- Remove Content Filter
- views_edit-post filter not working (custom post type)
- Upload file if contains certain name
- Filters/Bulk Actions return wrong URL in admin dashboard
- How to know what filter to use and how to use it?
- Replace audio links with jplayer using the_content filter
- Sorting a specific taxonomy by archive date using URL
- Give “Read More” precedence over excerpt() word count
- Adding a filter to comments_template
- How to customize category_description()?
- Add Bootstrap Classes to Recent Posts Widget
- Add filter to get_posts
- Is it possible to override the default Gallery Settings form?
- Filtering a list of objects with ‘OR’ on the same field
- Excerpt is being added above the content, but it should be after it
- WordPress add script with custom type (x-jquery-tmpl)
- How to filter bbPress replies (content)?
- Change login CSS
- How to redirect non-logged in users to login with post_password_required()
- How to add nonce tag to inline script for CSP
- Filter content for get_the_content()
- Change user nicename without sanitize
- How to override include_once pointed file using add_filter?
- How to strip out javascript in wp_posts `post_content`
- Register new user, assign custom role then send email
- How can I get the default content of WordPress post?
- How do I hide tinymce within the edit screen of a particular page
- What would cause the gettext filter to not work for a given text domain?
- pre_get_posts to hide everywhere posts from “Archive” category
- Strip $before & $after strings from a page title
- How to remove shortcode(s) from WYSIWYG Page editor for Non Admins
- What is the action or filter for adding information under the Permalink in Edit Post/Page?
- add after content don’t work
- Adding a filter to related posts not working
- need correction with a snippet in functions.php [closed]
- add_action with associative array
- Why does wp_die() not work when inside a namespace?
- Apply pre_get_posts filter in a certain moment (just for a particular block of posts)
- Remove image of srcset
- Set post featured image to author image
- How to Change the WordPress Locale with the ‘locale’ Filter?
- meta box loop problem with a search filter
- How to make the show as a button?
- Take filter from multiple functions
- Read More in the actual excerpt
- WP REST API v2. filters doesn’t work
- Is it possible to include the add_filter() function within a shortcode function
- Activate short codes for all post queries?
- filter on the_content stopped working when I updated to WP 3.6.1
- Replace Paid Shipping Method With Free Shipping Method WooCommerce [duplicate]
- Wrapping Featured Image on Add/Edit Page in div?
- Clean/filter HTML inserted to post content by XML RPC
- how to localize the number of wordpress post views?
- Is it possible to make get variable out of filter in Class?
- NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]
- How to elect position of new item output in a dropdown when using add_filter
- Query Multiple Filters, one with Meta
- How to remove a filter that is an object method?