-
BennyO
Hi all,
I am using code snippet to “inject” this code:<?php add_action('wp_body_open', function() { ?> <div class="smooth-wrapper"> <div class="smooth-content"> <?php }); add_action('generate_after_footer', function() { ?> </div> </div> <?php
I would like to exclude the frontpage.
What is the best way to go about it?I tried using a hook element but somehow I failed.
Thanks in advance
-
Hi there,
You can wrap your HTML output using an if condition.
And for not!
front_page you can use this :! is_front_page()
add_action('wp_body_open', function() { if ( ! is_front_page() ) { ?> <div class="smooth-wrapper"> <div class="smooth-content"> <?php } }); add_action('generate_after_footer', function() { if ( ! is_front_page() ) { ?> </div> </div> <?php } });
-
BennyO
Excellent, David.
Thanks very much. -
You’re welcome
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.