This website uses cookies to remember you and improve your experience. For more info see our Privacy Policy.

  • About
  • Websites
    • Business Websites
    • Author Websites
  • SEO
  • Portfolio
    • Author Web Design
    • Business Web Design
    • Custom Graphics
    • Logos
  • Services & Pricing
    • Author Website Packages
    • Website Hosting
    • Page Speed Optimization
    • SEO
    • Local SEO
  • MyBookTable
    • MyBookTable Support
  • Contact
  • Hire Us

Mobile Menu

  • Menu
  • Skip to right header navigation
  • Skip to main content

Stormhill Media

Custom websites for every type of business

Header Right

  • About
  • Websites
    • Business Websites
    • Author Websites
  • SEO
  • Portfolio
    • Author Web Design
    • Business Web Design
    • Custom Graphics
    • Logos
  • Services & Pricing
    • Author Website Packages
    • Website Hosting
    • Page Speed Optimization
    • SEO
    • Local SEO
  • MyBookTable
    • MyBookTable Support
  • Contact
  • Hire Us

Add a class to the Body Class

Home » Code Snippets » Add a class to the Body Class

So you need to add a class to the body classes to get stuff to work right. Here is a way to do it. Also, change woocommerce-page to something useful to you.

function mlp_add_a_filter($classes){
	$classes[]="woocommerce-page";
	return $classes;
	}

add_filter('body_class','mlp_add_a_filter');

If you know you are using PHP 5.3 or above, here is a quicker way

add_filter('body_class',function($classes){$classes[]="woocommerce-page";return $classes;});
« Previous
Next »

Site Footer

Quick Links:

  • Contact Us
  • Pricing & Services
  • Sitemap
  • Terms/Conditions
  • Privacy Policy
  • Business Websites
  • Author Websites
  • SEO Services
(903) 213-5266‬

Copyright © 2025 · Stormhill Media All Rights Reserved.
Website by Stormhill Media
Log in