0

I have a custom WP page and want to be able to target different page id classes. When I add body_class() to the header <body> section it outputs all classes to the page!

I also have a gtag Google Analytics script tag at the start of the header but I don't think that should affect it.

     <!DOCTYPE html>
<html>
    <head>


<meta name="google-site-verification" content="Ey9SSwK6cHm5KMRuCUinWcWx1URGF8FZ8FV5HnG2B4A" />
    <?php wp_head(); ?>
    <title>The Carnivore Diet - The Ultimate Diet for Weight loss, Digestion and Inflammation!</title>
</head>
<body>
    <?php body_class(); ?>> 
halfer
  • 19,824
  • 17
  • 99
  • 186
Chris Cullen
  • 110
  • 9

1 Answers1

0

The answer was I had to have body_class() in the body tag:

<body <?php body_class(); ?>>
halfer
  • 19,824
  • 17
  • 99
  • 186
Chris Cullen
  • 110
  • 9