• Hi,

    I’m wondering if there is a way to made sidebar only for posts page. In edit mode, this sidebar is set to other, but at the minute I’m changing this page into posts page sidebar goes back to primary, not custom.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Andrea Rennick

    (@andrea_r)

    The posts use the default layout. It’s best to set the default layout to the layout you wish to use on the bulk of your content.

    then you change what you want on the smaller number of pages.

    /**
     * Get the custom sidebar for blog pages using Genesis Simple Sidebars
     * 
     * Priority is set to 9 so we set the "default" sidebar to that of the
     * Page for Posts before the Simple Sidebars plugin alters it
     */
    add_filter( 'sidebars_widgets', 'my_sidebar_widgets_filter', 9 );
    function my_sidebar_widgets_filter( $widgets ) {
    	if ( ! ( is_home() || is_singular( 'post' ) || ( is_archive() && ! is_post_type_archive() ) ) )
    		return $widgets;
    	$page_for_posts = get_option( 'page_for_posts' );
    	$sidebars = array(
    		'sidebar'      => genesis_get_custom_field( '_ss_sidebar', $page_for_posts ),
    		'sidebar-alt'  => genesis_get_custom_field( '_ss_sidebar_alt', $page_for_posts ),
    		'header-right' => genesis_get_custom_field( '_ss_header', $page_for_posts ),
    	);
    	$widgets = Genesis_Simple_Sidebars()->core->swap_widgets( $widgets, $sidebars );
    	return $widgets;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is it possible to have another sidebar for posts page?’ is closed to new replies.