• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Help with conditional tag!

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: conditionals, php, Sidebar

  • This topic has 3 replies, 2 voices, and was last updated 10 years, 12 months ago by Brad Dalton.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 27, 2014 at 8:58 pm #107076
    designslucid
    Member

    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
    May 27, 2014 at 8:59 pm #107077
    designslucid
    Member

    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.

    May 27, 2014 at 9:08 pm #107078
    designslucid
    Member

    Got it! Simple syntax errors.

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

    May 28, 2014 at 1:25 am #107091
    Brad Dalton
    Participant

    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/


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble