• 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

Conditional for displaying entire widget areas

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 › Conditional for displaying entire widget areas

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 10 years, 4 months ago by webkompaan.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 28, 2016 at 4:15 am #182357
    webkompaan
    Participant

    I'm using the Widget Logic plugin to display or hide widgets. But now I'm using so many different widgets on different pages that I think it is much more efficient to create three different sidebars. Each in the same place, but displaying on different sections of the website. For instance, the blog section, the photo section, the shop section.

    How can I do this?

    March 28, 2016 at 7:47 am #182368
    Mike
    Member

    Genesis simple sidebars would serve you well I believe. https://wordpress.org/plugins/genesis-simple-sidebars/

    March 31, 2016 at 6:03 am #182580
    webkompaan
    Participant

    Ok, thanks.
    I found this code I used and that works. But perhaps this plugin you mention is easier, because I need more than one replacement.

    add_action('get_header','cd_change_genesis_sidebar');
    function cd_change_genesis_sidebar() {
        global $post;
    	$ancestors = get_post_ancestors( $post );
    	if ( is_page( 'fotografie' )  || in_array( '12923', $ancestors) ) {
            remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); //remove the default genesis sidebar
            add_action( 'genesis_sidebar', 'cd_do_sidebar' ); //add an action hook to call the function for my custom sidebar
        }
    }
    
    function cd_do_sidebar() {
    	dynamic_sidebar( 'nextgen' );
    }
  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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

© 2026 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