Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 9th, 2011  |  syntax: PHP  |  size: 0.87 KB  |  views: 83  |  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.  
  10. $args = array(
  11.   'taxonomy'     => $taxonomy,
  12.   'orderby'      => $orderby,
  13.   'show_count'   => $show_count,
  14.   'pad_counts'   => $pad_counts,
  15.   'hierarchical' => $hierarchical,
  16.   'title_li'     => $title,
  17.   'hide_empty'   => $empty,
  18.  
  19. );
  20.                            
  21. $cats = explode("<br />",wp_list_categories( $args ));
  22. $cat_n = count($cats) - 1;
  23. for ($i=0;$i<$cat_n;$i++):
  24. if ($i<$cat_n/2):
  25. $cat_left = $cat_left.'<li>'.$cats[$i].'</li>';
  26. elseif ($i>=$cat_n/2):
  27. $cat_right = $cat_right.'<li>'.$cats[$i].'</li>';
  28. endif;
  29. endfor;
  30. ?>
  31. <ul class="left">
  32. <?php echo $cat_left;?>
  33. </ul>
  34. <ul class="right">
  35. <?php echo $cat_right;?>
  36. </ul>