WordPress get categories list

How to wordpress get categories list easily.You can get categories list by wp_list_categories() core function.It is listing as categories names as a list.

$catagoriesArr = explode("
",wp_list_categories('title_li=&echo=0&depth=1&style=none')); $catagoriesCount = count($catagoriesArr)-1;// array size $catagoryName = '
    '; for ($i=0; $i<$catagoriesCount; $i++){ $catagoryName .= '
  • '.$catagoriesArr[$i].'
  • '; } $catagoryName .= '
'; echo $catagoryName;

wordpress get categories list as two columns

",wp_list_categories('title_li=&echo=0&depth=1&style=none'));
$catagoriesCount = count($catagoriesArr)-1;// array size
for ($i=0; $i<$catagoriesCount; $i++){
	 if ($i%2==1){
		$col_left = $col_left.'
  • '.$catagoriesArr[$i].'
  • '; } else { $col_right = $col_right.'
  • '.$catagoriesArr[$i].'
  • '; } } ?>

    This is a another way to get categories list or full details.

    echo '
      '; $categories = get_categories(); foreach ($categories as $cat) { echo '
    • '.$cat->cat_name.'
    • '; } echo '
    ';

    How can I get posts or pages in specific category

    
            
  • No need to worry about to get categories details.:p
    Navigate and open the following file.There are many functions to get category details.
    /wp-includes/category-template.php