• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to user navigation

PopWP

WordPress and Genesis Tutorials

  • Get Started
  • About
  • Archive
  • Services
  • Membership
  • My Account

Add extra class to HTML elements in Genesis

Last Updated on July 20, 2019 Favorited: 0 times

Sometimes, We are required to add additional class into a specific element container to add some additional features and customizations.

One can add multiple classes into different HTML markup and container via Genesis filters.

Open functions.php and add the following

//* Add extra class to content
function designody_add_class( $attributes ) {
  $attributes['class'] = $attributes['class']. ' your-extra-class';
    return $attributes;
}
add_filter( 'genesis_attr_content', 'designody_add_class' );

and change

  1. your-extra-class to name of the class.
  2. genesis_attr_content with other attr value

Genesis offers “Attributes” via filters to add additional customization to a specific container and we can find all in Genesis Attributes post.

Categories: Free Content, Genesis Tutorials Tags: extra class, genesis attr

Reader Interactions

Primary Sidebar

Search

WPEngine WordPress Hosting, Perfected.

Hosting You are looking for?.
Perfect solution for small business to global enterprise.

Learn more

StudioPress Genesis Theme Framework

The No.1 Theme Provider.
Creative, SEO rich Theme for all niche projects.

Learn more

Categories

  • Free Content
  • Genesis Tutorials
  • Premium Content
  • Snippets
  • What's New?
  • WordPress Tutorials

Tag Cloud

Archive Background Section blog canvas menu center logo columns conditional tags CSS CSS Grid custom Customizer custom post type Custom Post Types custom template Custom Widget effect eNews Extended Featured Image front-page Genesis Genesis Sample header right hero section Image Background js layout left menu Logo menu Navigation Menu newsletter post page related posts responsive menu search search widget Shrinking Logo site header slide in-out Stylesheet Template Utility Bar Video Background widgets WordPress

Built with Genesis Framework + WordPress by Aryan Raj

  • Contact
  • FAQ
  • Disclaimer
  • Privacy Policy
  • Copyright Policy
  • Terms of Service