inkthemes_get_category_id

The Black Rider Lite Responsive Theme inkthemes get category id function.

Description

inkthemes_get_category_id( (string) $cat_name ); 

Parameters (1)

0. $cat_name (string)
The cat name.

Usage

  1. if ( !function_exists( 'inkthemes_get_category_id' ) ) { 
  2. require_once '/functions/inkthemes-functions.php'; 
  3.  
  4. // The cat name. 
  5. $cat_name = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = inkthemes_get_category_id($cat_name); 
  9.  

Defined (1)

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

/functions/inkthemes-functions.php  
  1. function inkthemes_get_category_id($cat_name) { 
  2. $term = get_term_by('name', $cat_name, 'category'); 
  3. return $term->term_id;