Looking to display a right sidebar, but only on single posts with rest of the site’s pages appearing in full content layout in your Genesis site?
Just follow these steps.
Step 1
Go to Genesis > Theme Settings in your WordPress dashboard, scroll to “Default Layout” section, select the full width content layout and save changes.
Step 2
Add the following in child theme’s functions.php:
add_filter( 'genesis_pre_get_option_site_layout', 'custom_set_single_posts_layout' );
/**
* Apply Content Sidebar content layout to single posts.
*
* @return string layout ID.
*/
function custom_set_single_posts_layout() {
if ( is_single() ) {
return 'content-sidebar';
}
}
Hi Sridhar,
Thanks for your great posts! I was wondering, can I also apply the content sidebar to a specific page? What kind of code do I need for that?
Thanks in advance.
Kind regards,
Vildan
No code needed for that.
Click on the Genesis icon when editing any Page in the WordPress editor and select your desired layout from the Layout meta box.