Help with conditional tag!

Community Forums Forums Design Tips and Tricks Help with conditional tag!

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  braddalton 3 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #107076

    Post count: 3

    How can I make this statement be used only on the home page?

    <div class="home-slider"><?php dynamic_sidebar('home-slider');?></div>

    I’ve tried:

    <div class="home-slider"><?php is_home() dynamic_sidebar('home-slider');?></div>

    <div class="home-slider"><?php is_home() {dynamic_sidebar('home-slider');}?></div>

    Neither with any luck. If this is neccesary to know, I’m using simple hooks where inserting this code.

    Post count: 3

    The first statement – is being used currently in simple hooks with NO issues. I just don’t want the slider to appear on any pages except the home page.


    Post count: 3

    Got it! Simple syntax errors.

    <div class="home-slider"><?php if (is_front_page()){ dynamic_sidebar('home-slider');}?></div>


    Post count: 9759

    That’s not really the correct way to code it but it will work.

    Here’s another way to do it from your functions file

    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.