• 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 blog page and single post pages 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 blog page and single post pages only

This topic is: not resolved

Tagged: widget area

  • This topic has 2 replies, 1 voice, and was last updated 11 years, 7 months ago by ncg.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • November 14, 2013 at 7:53 am #72921
    ncg
    Member

    Hi, I have the new wintersong theme running and would like to make a more robust menu on the blog page and single post pages only so that I can keep the clean and simple look throughout the rest of the site. We tried this: (Jonathan is my son who found this code somewhere....) However, it broke the site. The wiintersong theme already has a "Register widget areas" section, so I tried to simple add it there. But it broke the site again. Here's my site: http://www.nathanclarkgeorge.com

    Thanks for you help!!
    nathan

    --

    //* Jonathan added the following to in order to reposition the widgets

    /** Register widget areas */

    genesis_register_sidebar( array(
    'id' => ‘header-1’,
    'name' => __( ‘After Header’, 'mp' ),
    'description' => __( 'This is the after header before content section.’, 'mp' ),
    ) );

    add_action( 'genesis_after_header', ‘ws_header-1_genesis' );

    /**
    * Add CTA widget support for site. If widget not active, don't display
    *
    */
    function ws_header-1_genesis() {

    // Don't display the CTA on the home page

    if ( is_home() ) {
    return;
    }

    // If it's the Blog page, display header-1
    elseif ( is_page( ‘Blog’ ) ) {
    genesis_widget_area( ‘header-1’, array(
    'before' => '<div id=“header-1”><div class="wrap">',
    'after' => '</div></div>',
    ) );

    }

    //* End of Jonathan’s additions

    http://www.nathanclarkgeorge.com
    November 14, 2013 at 7:57 am #72923
    ncg
    Member

    By the way, I'm hoping to place the widget area at the top of the page where I can add a search bar, a recent posts widget, and categories widget.

    November 14, 2013 at 11:06 am #72964
    ncg
    Member

    I'm thinking that because the way Wintersong utilizes the header and already has a custom afterheader widget area, I would have to use a "before content" type of function. I get css, but php is still a steep learning cure for me. Thanks!

  • 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

© 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