Writing a conditional in header.php
-
I started a new site, have a custom slider plugin and only want the slider to appear on the home page above the main content area. I created a child theme (of formationpro), made a copy of header.php and inserted the code below at the very bottom of that file. Even though I targeted the front page and home page, the slider still appears on all pages.
Is there another solution available to get the desired results?
<?php is_front_page() && is_home(); { ?>
<div class=”new-slider”>
<?php wd_slider(2); ?>
</div>
<?php } ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Writing a conditional in header.php’ is closed to new replies.