Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Set the GP footer widgets with a function
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
// If we're on a category, show a different number of widgets
if ( is_category() ) :
return '5'; // Show 5 footer widgets
// 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