Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set the GP footer widgets with a function
add_filter('generate_footer_widgets','generate_custom_footer_widgets');
function generate_custom_footer_widgets()
{
// If we're on the posts page, set a number of footer widgets
if ( is_home() ) :
return '3'; // Show 3 footer widgets
endif;
// If we're on a category, show a different number of widgets
if ( is_category() ) :
return '5'; // Show 5 footer widgets
endif;
// For everything else, return the default
return $widgets;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment