Site logo

Archived topic

Different sidebars for posts and pages

30 replies · Started by Joni on February 11, 2018

Viewing posts 16–30 of 31

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.

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!

New sidebar for pages

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 ?

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,

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' );
	}
}
This archived topic is closed to new replies.