responsive_mobile_categorized_blog

Returns true if a blog has more than 1 category.

Description

responsive_mobile_categorized_blog(); 

Usage

  1. if ( !function_exists( 'responsive_mobile_categorized_blog' ) ) { 
  2. require_once '/includes/functions-template-tags.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = responsive_mobile_categorized_blog(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/functions-template-tags.php  
  1. function responsive_mobile_categorized_blog() { 
  2. if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) { 
  3. // Create an array of all the categories that are attached to posts. 
  4. $all_the_cool_cats = get_categories( array( 'hide_empty' => 1 ) ); 
  5.  
  6. // Count the number of categories that are attached to the posts. 
  7. $all_the_cool_cats = count( $all_the_cool_cats ); 
  8.  
  9. set_transient( 'all_the_cool_cats', $all_the_cool_cats ); 
  10.  
  11. if ( '1' != $all_the_cool_cats ) { 
  12. // This blog has more than 1 category so responsive_mobile_categorized_blog should return true. 
  13. return true; 
  14. } else { 
  15. // This blog has only 1 category so responsive_mobile_categorized_blog should return false. 
  16. return false;