updating template-tags

This commit is contained in:
koenemann 2017-02-07 15:26:45 +01:00
parent 5ae85ca5fa
commit d553448a75
1 changed files with 2 additions and 6 deletions

View File

@ -80,22 +80,18 @@ function understrap_categorized_blog() {
$all_the_cool_cats = get_categories( array(
'fields' => 'ids',
'hide_empty' => 1,
// We only need to know if there is more than one category.
'number' => 2,
) );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'understrap_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so understrap_categorized_blog should return true.
// This blog has more than 1 category so components_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so understrap_categorized_blog should return false.
// This blog has only 1 category so components_categorized_blog should return false.
return false;
}
}