Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set a sidebar on the blog homepage only
add_filter( 'generate_sidebar_layout','generate_custom_blog_sidebar_layout' );
function generate_custom_blog_sidebar_layout( $layout )
{
// If we are on the blog homepage, set the sidebar
if ( is_home() )
return 'right-sidebar';
// Or else, set the regular layout
return $layout;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment