Site logo

Archived topic

Issues with custom foot widgets

1 reply · Started by Thomas on January 19, 2018

Viewing posts 1–2 of 2

For some reason, the code below is not working for me.

Im trying to set
cpt1 = 3 widgets (working)
blog single pages = 3 (not working)
default = 0 (working)

add_filter( 'generate_footer_widgets','tu_custom_blog_footer_widgets' );
function tu_custom_blog_footer_widgets( $widgets )
{
// If we are on the blog, set the number
if ( is_singular( 'cpt1' ) )
return '3';

if ( is_singular( 'post' ) )
return '3';

// Or else, set the regular number
return $widgets;

}

This archived topic is closed to new replies.