advantage_meta_category

The Advantage advantage meta category function.

Description

advantage_meta_category( (int) $meta_icon = 0 ); 

Parameters (1)

0. $meta_icon — Optional. (int)
The meta icon.

Usage

  1. if ( !function_exists( 'advantage_meta_category' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The meta icon. 
  5. $meta_icon = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = advantage_meta_category($meta_icon); 
  9.  

Defined (1)

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

/functions.php  
  1. function advantage_meta_category( $meta_icon = 0 ) { 
  2. $categories = wp_get_post_categories( get_the_ID() , array('fields' => 'ids')); 
  3. if( $categories ) { 
  4. $sep = ' • '; 
  5. $cat_ids = implode( ', ' , $categories ); 
  6. $cats = wp_list_categories( 'title_li=&style=none&echo=0&include='.$cat_ids); 
  7. $cats = rtrim( trim( str_replace( '<br />', $sep, $cats) ), $sep); 
  8. echo '<span class="entry-category">'; 
  9. if ( 1 == $meta_icon ) 
  10. echo '<i class="icon-folder-open meta-icon"></i>'; 
  11. else 
  12. echo '<span class="meta-prep">' . __( 'Filed in ', 'advantage') . '</span>';  
  13. echo $cats; 
  14. echo '</span>';