• Skip to main content
  • Skip to primary sidebar

Victor Font Consulting Group, LLC

The DEX Intranet Specialists

  • 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

March 6, 2015 By Victor M. Font Jr.

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

Filed Under: Code Snippet, Computers and Internet, CSS, Genesis, Programming, Tutorial Tagged With: Code Snippet, Computers and Internet, CSS, Genesis, Programming, Tutorial

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.

Primary Sidebar

Shopping Cart

Books

  • Ultimate Guide to the SDLC front cover The Ultimate Guide to the SDLC
    Rated 5.00 out of 5
    $74.95
  • Winning With WordPress Basics 2nd Edition Winning With WordPress Basics 2nd Edition $19.95

Recent Articles

  • Modern Scam Defense: How Consumers and Businesses Can Recognize and Stop Email, Phone, and Text Fraud
  • How to Write a PRD So Dense It’s Technically a Novel
  • Top 5 Plugin Names That Scare Our Legal Department
  • When Agile Meets Our 3-Year Waterfall Roadmap: A Love Story
  • Why Our Enterprise Needs 27 Stakeholders to Approve a Button Color Change

Top 10 Article Categories

Best Practice Code Snippet Computers and Internet Genesis How To Leadership Programming Servant Leadership Tutorial WordPress

 
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.