• Skip to main content

Victor Font Consulting Group, LLC

Strategic IT Solutions for Complex Organizations

  • Home
  • Care Plans
    • Care Articles
    • Optional Subscriptions
  • Consultations
  • Products
    • Code Snippets
    • Public GitHub Repositories
    • Gist Snippets
    • Pastebin Snippets (Free)
    • Free Plugins
  • FAQs
  • Support
    • Graphic Design
  • Contact
    • Speakers
    • Portfolio
  • Resources
    • Free WordPress Video Training
    • Tutorials
    • Articles
    • Cybersecurity
    • EU Referral Network

Genesis Framework: Add a Custom CSS Class to Elements

posted on March 6, 2015

A common question about the Genesis Framework is "How do I add a custom class to a [specific] HTML element?"

In many cases, the person asking the question asks where in the Genesis Core files can they change the markup for the element they want to modify. First of all, it's always a very BAD idea to ever change Genesis Framework Core files. Doing so can lead all kinds of problems down the line because future framework updates will overwrite your changes and you'll find yourself in a regular cycle of update and reapply modifications. But, don't fret, there's a much simpler way. The code below is an example of how to add a custom class to the entry-content div.

Other popular areas to add custom class to are the navigation and sidebar items as well as many other. Replace the genesis_attr_entry-content hook in the add-Filter call above with any of the following to add a class to the corresponding element:

genesis_attr_adjacent-entry-pagination
genesis_attr_archive-pagination
genesis_attr_author-box
genesis_attr_body
genesis_attr_comment
genesis_attr_comment-author
genesis_attr_comment-author-link
genesis_attr_comment-content
genesis_attr_comment-time

genesis_attr_comment-time-link
genesis_attr_comments-pagination
genesis_attr_content
genesis_attr_entry
genesis_attr_entry-author
genesis_attr_entry-author-link
genesis_attr_entry-author-name
genesis_attr_entry-comments
genesis_attr_entry-content
genesis_attr_entry-image

genesis_attr_entry-image-grid-loop
genesis_attr_entry-image-widget
genesis_attr_entry-meta-after-content
genesis_attr_entry-meta-before-content
genesis_attr_entry-modified-time
genesis_attr_entry-pagination
genesis_attr_entry-time
genesis_attr_entry-title
genesis_attr_header-widget-area

  • 14shares
  • Facebook0
  • Twitter3
  • Pinterest0
  • LinkedIn3
  • Print
  • SMS4

About Victor M. Font Jr.

Victor M. Font Jr. is an award winning author, entrepreneur, and Senior IT Executive. A Founding Board Member of the North Carolina Executive Roundtable, he has served on the Board of Advisors, of the North Carolina Technology Association, the International Institute of Business Analysis, Association of Information Technology Professionals, Toastmasters International, and the North Carolina Commission for Mental Health, Developmental Disabilities, and Substance Abuse Services. He is author of several books including The Ultimate Guide to the SDLC and Winning With WordPress Basics, and Cybersecurity.

 
We only use analytical cookies on our website that allow us to recognize and count the number of visitors, but they do not identify you individually. They help us to improve the way our website works. By clicking Accept you, agree to cookies being used in accordance with our Cookie Policy.