Archived topic
Different sidebars for posts and pages
30 replies · Started by Joni on February 11, 2018
I'm always happy to help when I can :)
Thanks again!
Is there a way to add my own options to GP's Layout > Sidebars area in the page editor? If there's an action or filter, I'd like to just add a list of sidebars right there to choose from, and not have to add another plugin with it's messy interface. :)
#featurerequest
Found generate_layout_meta_box_content and generate_layout_meta_box_save. I'll play around with this.
That's the best place to look, for sure.
Also, keep an eye on our upcoming version, as some things have changed in that area: https://github.com/tomusborne/generatepress/tree/release/2.5.0
Here's a new and happy GP Premium user who finally got to debut a new sidebar on my chid theme just for pages thanks to this 2018 thread XD Thank you both!

JRMora / Cartoonist https://www.jrmora.com/blog
I want to have a different siderbar which i can create from a page using shortcodes. However, is there any way to display it on a page. Rest of the site can follow the standard sidebar.
Its been almost 2 + years of this post. Not sure if this functionality is natively available using Hooks or something ?
Not sure if I fully understand the requirement specifically on the shortcodes part.
This plugin is still likely your best bet:
https://en-ca.wordpress.org/plugins/content-aware-sidebars/
If you need further help, please start a new topic.
Thank you!
Hi Generatepress,
I am battling the same issue as the ones previously in this thread.
I have gone with content aware, and set up everything as it should (or so I imagine at least)
On my test page, the original sidebar is removed, and it revert to default, instead of updating with the new sidebar.
Check: https://childrenstoybox.co.uk/best-electric-scooters-in-the-uk/
Do u have an idea as to whats going wrong here?
Kind Rgards
Jacob
Hi there,
can you share a screenshot of the Content Aware settings?
HI David,
Sure, here are the screenshots
Conditions: https://prnt.sc/1qtwet3
Action: https://prnt.sc/1qtwh2v
Design: https://prnt.sc/1qtwiw1
Schedule: https://prnt.sc/1qtwkze
Options: https://prnt.sc/1qtwmkt
This is how the setting looks right now. Hope u can help me.
Thanks
Jacob
HI David,
Did u have an idea, as to what's causing the plugin not to work?
Kind Regards
Jacob
Have you tested it with the cache plugin disabled ?
Problem solved. The actual widget was not updated correctly.
Thanks
Jacob
Glad to hear you found the answer!!!
What I did was
1. duplicate /inc/general.php into my child theme
2. In that file, after
'sidebar-1' => __( 'Right Sidebar', 'generatepress' ),
'sidebar-2' => __( 'Left Sidebar', 'generatepress' ),
I added:
'sidebar-3' => __( 'Right Special Sidebar', 'generatepress' ),
3. duplicate /sidebar.php into my child theme
4. Add:
if ( is_page() ) {
if ( ! dynamic_sidebar( 'sidebar-3' ) ) {
generate_do_default_sidebar_widgets( 'right-special-sidebar' );
}
} else {
if ( ! dynamic_sidebar( 'sidebar-1' ) ) {
generate_do_default_sidebar_widgets( 'right-sidebar' );
}
}