How To Display your categories in two columns

Written by Jauhari · 27 sec read > 1.730 views


The stadard wp_list_categories() functions echoes a list of all your categories. With this simple trick we can display the categories in two columns. This code is easy to implemented and doesn’t need high level skill to add on our theme. Just paste this code on your theme file and you are ready to split your wp_list_categories()

[sourcecode language=’php’]
< ?php $cats = explode("
$cat_n = count($cats) – 1;
for ($i=0;$i< $cat_n;$i++): if ($i<$cat_n/2): $cat_left = $cat_left.'

  • ‘.$cats[$i].”;
    elseif ($i>=$cat_n/2):
    $cat_right = $cat_right.’

  • ‘.$cats[$i].’
  • ‘;

      < ?php echo $cat_left;?>
      < ?php echo $cat_right;?>


    After you copy this code and save it. Thanks to Blog Oh Blog and WP Recipes that share this tricks

    Written by Jauhari
    This is me Nurudin Jauhari. Just human like you, I come from Gunungkidul, small place at Yogyakarta, Living in Malang 1998-2004 and Today I live at @DesaPonjong Gunungkidul, Yogyakarta. I was born 30/04/1980 in Ponjong, small village in Gunungkidul, Almost my time in 1 - 15 Years stay at this Village. More Profile

    The Ultimate Guide To Online Dating

    kaylee in General
      ·   1 min read

    Glucose Daddies For Women

    Herman Santoni in General
      ·   1 min read

    10 Replies to “How To Display your categories in two columns”

    1. Lagi belajar banyak tentang WP… akhirnya blog bisa jadi blog rujukan yang paling tepat nie..
      nice tutor..

    2. Ping-balik: Green Earth Justin

    Tinggalkan Balasan

    Alamat email Anda tidak akan dipublikasikan.

    Situs ini menggunakan Akismet untuk mengurangi spam. Pelajari bagaimana data komentar Anda diproses.

    Up Next: Redesign