Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change the sidebar widths on the blog only
add_filter( 'generate_right_sidebar_width','generate_right_sidebar_width_blog_custom', 50 );
function generate_right_sidebar_width_blog_custom()
{
// If we're on the blog or an archive template
if ( is_home() || is_archive() ) {
return '20'; // 20% for your blog
}
// If the above isn't true, return your default value
return '25'; // 25% or whatever your default is
}
add_filter( 'generate_left_sidebar_width','generate_left_sidebar_width_blog_custom', 50 );
function generate_left_sidebar_width_blog_custom()
{
// If we're on the blog or an archive template
if ( is_home() || is_archive() ) {
return '20'; // 20% for your blog
}
// If the above isn't true, return your default value
return '25'; // 25% or whatever your default is
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment