• Resolved TatsujinUK

    (@tatsujinuk)


    I’m trying to target the body_class from within a specific php template file.

    Essentially, each page within the site has its own unique body class, and I’m trying to add into the php template file (not the functions file) some code to add some additional code (a slider) if the body_class matches and is left empty if it doesn’t match.

    Something like:

    <?php if ( body_class(‘term-business-practices-and-policies’) ) {?>
    // add slider code here
    <?php } ?>

    There will actually be 4 or 5 specific instances I need to target, each with different code (image)

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘body_class conditional’ is closed to new replies.