It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. I'm trying to edit classes in the body tag for custom post types so I can display the pages full width using the WooThemes Canvas built in full width class - instead of overriding it. By default it seems the body class is set to 'two-col-right' and 'two-col-right' for custom post types, I need them to be 'one-col' and 'one-col'. Simple you would think, but it seems there is no way to edit a class, only a way to filter it out and add a new one?
In This Article 🗂️
WordPress plugins help with extending the functionality of your site and performing advanced digital work with minimal effort. Perhaps you simply want to make some advanced customizations. In any of these instances, WordPress coding may be the next step. Fortunately, there are many ways you can go about it.
US & World
In this article, we will explain the WordPress body class with tips and tricks for aspiring theme designers to utilize them in their projects. This allows you to dynamically figure out which page a user is viewing and then add the CSS classes accordingly. Normally most starter themes and frameworks already include the body class function inside the HTML body tag. However, if your theme does not have it, then you can add it by modifying the body tag like this:. Depending on the type of page being displayed, WordPress automatically adds the appropriate classes.
These hooks remove the need to manually modify the theme files. Using this, we can do all kinds of cool things like inserting custom content into the header, the title, and the footer. This is particularly needed when using a tool like the Google Tag Manager.