Categories

Categories

$get_cats = wp_list_categories( 'echo=0&title_li=&depth=-1' );
$cat_array = explode('

‘,$get_cats);
$results_total = count($cat_array);
$cats_per_list = ceil($results_total / 4);
$list_number = 1;
$result_number = 0;
?>

    foreach($cat_array as $category) {
    $result_number++;
    if($result_number % $cats_per_list == 0) {
    $list_number++;
    echo $category.'
    ‘;
    }
    else {
    echo $category.’

    ‘;
    }
    } ?>