skt_black_getPostCategories

The SKT Black skt black getPostCategories function.

Description

skt_black_getPostCategories(); 

Usage

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

Defined (1)

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

/inc/custom-functions.php  
  1. function skt_black_getPostCategories() { 
  2. $categories = get_the_category(); 
  3. $catOut = ''; 
  4. $separator = ', '; 
  5. $catOutput = ''; 
  6. if($categories) { 
  7. foreach($categories as $category) { 
  8. $catOutput .= '<a href="'.get_category_link( $category->term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s", 'skt-black' ), $category->name ) ) . '">'.$category->cat_name.'</a>'.$separator; 
  9. $catOut = 'Categories: '.trim($catOutput, $separator); 
  10. return $catOut;