- This topic has 1 reply, 2 voices, and was last updated 6 years, 11 months ago by .
- The forum ‘General Discussion’ is closed to new topics and replies.
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.
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?
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/
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.
© 2023 WPEngine, Inc.