• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Remove Class From WordPress Body & Post Classes

These code snippets enable you to remove body & post classes in WordPress.

You can use the code directly in a template file which uses the WordPress Template hierarchy or via your functions file if you add a conditional tag after the function.

This code comes in handy when you want to use a front-page.php template on archives or elsewhere in the same theme as you don’t need to remove or modify existing CSS for classes generated by the template file you want to re-use.

Here’s the code snippets for logged in members:

Register for full access

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems