This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 10th, 2011  |  syntax: PHP  |  size: 1.08 KB  |  views: 60  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.     $taxonomy     = 'categories';
  3.     $orderby      = 'name';
  4.     $show_count   = 0;      // 1 for yes, 0 for no
  5.     $pad_counts   = 0;      // 1 for yes, 0 for no
  6.     $hierarchical = 1;      // 1 for yes, 0 for no
  7.     $title        = 'Categories';
  8.     $empty        = 0;
  9.     $echo         = 0;
  10.  
  11.     $args = array(
  12.       'taxonomy'     => $taxonomy,
  13.       'orderby'      => $orderby,
  14.       'show_count'   => $show_count,
  15.       'pad_counts'   => $pad_counts,
  16.       'hierarchical' => $hierarchical,
  17.       'title_li'     => $title,
  18.       'hide_empty'   => $empty,
  19.       'echo'         => $echo,
  20.      
  21.     );
  22.                                
  23.     $cats = explode("<br />",wp_list_categories( $args ));
  24.     $cat_n = count($cats) - 1;
  25.     for ($i=0;$i<$cat_n;$i++):
  26.     if ($i<$cat_n/2):
  27.     $cat_left = $cat_left.'<li>'.$cats[$i].'</li>';
  28.     elseif ($i>=$cat_n/2):
  29.     $cat_right = $cat_right.'<li>'.$cats[$i].'</li>';
  30.     endif;
  31.     endfor;
  32.     ?>
  33.     <ul class="left">
  34.     <?php echo $cat_left;?>
  35.     </ul>
  36.     <ul class="right">
  37.     <?php echo $cat_right;?>
  38.     </ul>
clone this paste RAW Paste Data