Reply To: Activate masonry only for categories

Home Forums Support Activate masonry only for categories Reply To: Activate masonry only for categories

Home Forums Support Activate masonry only for categories Reply To: Activate masonry only for categories

#97685
Tom
Lead Developer
Lead Developer

Hi there,

The code snippets below will enable masonry on categories only, and remove the sidebars as well:

add_filter('generate_blog_masonry','generate_blog_enable_category_masonry');
function generate_blog_enable_category_masonry()
{
        // If we're on a category, enable masonry
	if ( is_category() )
		return 'true';
	
        // Otherwise, disable it
	return 'false';
}

add_filter('generate_sidebar_layout','generate_category_sidebar');
function generate_category_sidebar($layout)
{
	if ( is_category() ) :
		return 'no-sidebar';
	endif;

	return $layout;
}