• 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

Conditionally display slider

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 › Conditionally display slider

This topic is: resolved

Tagged: conditional tags, genesis responsive slider, genesis sample

  • This topic has 1 reply, 2 voices, and was last updated 9 years, 7 months ago by mmjaeger.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • December 14, 2015 at 8:58 am #173770
    mairagall
    Member

    Hello, I've added the Genesis Responsive Slider in a Genesis Sample based theme. I need it to be displayed only in the front page, this is my code:

    //*Register slider widget area
    genesis_register_sidebar( array(
    'id' => 'slider-area',
    'name' => __( 'Slider', 'genesis' ),
    'description' => __( 'This is the slider area', 'sense' ),
    ) );
    
    //* Add slider widget area 
    add_action( 'genesis_before_content_sidebar_wrap', 'slider_area' );
    function slider_area() {
    if ( is_front_page() ){
    genesis_widget_area( 'slider-area', array(
    'before' => '<div class="slider-area widget-area">',
    'after' => '</div>',
    ) );
    }}

    With this conditional tag, I was to remove the slider from posts, pages and archives pages but it still display the slider in page 2, page 3 and so. What should I do to show the slider only in the front page?

    I appreciate any help.
    Thanks!

    EDIT: I'm not using a static page but the latest posts as my front page, if I use is_home it does the same thing as is_front_page

    December 14, 2015 at 9:43 am #173774
    mmjaeger
    Member

    How about this:

    if ( is_front_page() && ! is_paged() ){

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Conditionally display slider’ is closed to new 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