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 6 months, 3 weeks ago.

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

    designslucid
    Member
    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.

    http://www.designslucid.com
    #107077

    designslucid
    Member
    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.

    #107078

    designslucid
    Member
    Post count: 3

    Got it! Simple syntax errors.

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

    #107091

    braddalton
    Participant
    Post count: 10675

    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 http://wpsites.net/web-design/add-ribbon-to-slider-images-for-tagging-your-best-stories/


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

You must be logged in to reply to this topic.