• 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

Add widget area to one page only

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 › Add widget area to one page only

This topic is: not resolved

Tagged: add widget area, add widget to one page

  • This topic has 4 replies, 3 voices, and was last updated 11 years ago by Badlywired.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • February 2, 2015 at 12:29 pm #139426
    LeaChristine
    Member

    I've read and tried following other answers to this question, but cannot get it to work-- I want to add a widget area above my blog post area, but only have it appear on the page that publishes my posts. In this case, it's called "Graffiti Wall." Right now I have the widget area displaying properly, but it's also on every other page-- does anyone know how I can just single out the Graffiti wall page to display it? Thanks for any help-- here is what I have right now in my functions.php:

    //* Add text section above posts
    genesis_register_sidebar( array(
    'id' => 'new-widget',
    'name' => __( 'New Widget', 'domain' ),
    'description' => __( 'Add Content Here', 'domain' ),
    ) );

    add_action( 'genesis_before_loop', 'your_widget' );
    function your_widget() {
    if ( comments_open() && is_active_sidebar('new-widget') ) {
    genesis_widget_area( 'new-widget', array(
    'before' => '<div class="new-widget widget-area">',
    'after' => '</div>',
    ) );

    }

    }

    I have tried to add a new conditional with both if ( is_page('006') && is_active_sidebar('new-widget') ) and if ( is_page('graffiti-wall') && is_active_sidebar('new-widget') ) but neither of them worked-- they just made the widget disappear entirely.

    The page ID for the graffiti wall should be 6.

    Site URL:

    http://www.sampleblogdesign.us/graffiti-wall/
    February 2, 2015 at 12:36 pm #139429
    LeaChristine
    Member

    I think I fixed it-- with this:

    //* Add text section above posts
    genesis_register_sidebar( array(
    'id' => 'new-widget',
    'name' => __( 'New Widget', 'domain' ),
    'description' => __( 'Add Content Here', 'domain' ),
    ) );

    add_action( 'genesis_before_loop', 'your_widget' );
    function your_widget() {
    if ( is_front_page() && is_home() ) {
    } elseif ( is_home() ) {
    genesis_widget_area( 'new-widget', array(
    'before' => '<div class="new-widget widget-area">',
    'after' => '</div>',
    ) );

    }

    }

    February 2, 2015 at 10:37 pm #139480
    Lauren @ OnceCoupled
    Member

    Cool, glad you figured this out! I was just about to share this link, which is the solution you used: http://codex.wordpress.org/Conditional_Tags#The_Blog_Page

    Also, for future reference, please use code tags as anyone who copies your current code will break their site.

    Properly formatted code looks like this.

    Best,
    Lauren


    We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com

    February 3, 2015 at 8:03 am #139510
    LeaChristine
    Member

    Thanks Lauren!

    February 3, 2015 at 5:06 pm #139567
    Badlywired
    Member

    Your solution is correct.

    It is common misunderstanding that the blog page is a page. It isn't in wordpress terms it is_home().

    Even if you created a page and assign it to the blog posts (settings > readings ) I assume that is what you have the 'page' isn't really used at all.


    My techy blog WordPress and stuff badlywired.com

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 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