• 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

Hooking primary sidebar to genesis_after_header

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 › General Discussion › Hooking primary sidebar to genesis_after_header

This topic is: not resolved

Tagged: hooks, Sidebar

  • This topic has 1 reply, 2 voices, and was last updated 9 years, 2 months ago by carasmo.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • October 13, 2016 at 12:23 pm #194675
    Amber
    Member

    I'm attempting to remove the primary sidebar from the content area and hook it to genesis_after_header. I've been able to do this:

    remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
    add_action( 'genesis_after_header', 'genesis_do_sidebar' );

    but it removes the <aside class="sidebar sidebar-primary widget-area"> wrapper on it and this makes it near impossible to style the sidebar as a whole now.

    Is there a way to have it maintain it's classes so I can style it? Or wrap it in another div?

    Also, doesn't remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); remove the sidebar and then add_action( 'genesis_after_header', 'genesis_do_sidebar' ); place it now where you've stated? My primary sidebar is still below in it's normal spot AND above at genesis_after_header now and I'm not sure why.

    Thank you for any help or insight on this as it's been driving me crazy for the last 4 hours..

    http://drivetrain.cartanium.com/
    October 13, 2016 at 9:26 pm #194695
    carasmo
    Participant

    Those are not the correct hooks, these are:

    remove_action( 'genesis_after_content', 'genesis_get_sidebar' );
    add_action( 'genesis_after_header', 'genesis_get_sidebar' );

    This is a bad idea. If you want a widget area there, register a new widget area and hook it there. If you want to move the sidebar before content, then it wouldn't go in the genesis_after_header hook it would go in the genesis_before_content hook:

    remove_action( 'genesis_after_content', 'genesis_get_sidebar' );
    add_action( 'genesis_before_content', 'genesis_get_sidebar' );

    This is for cases when you want the same layout on desktop but you want your sidebar before the content on smaller viewports.


    Genesis Theme Customization and Help

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ 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