Advertisement
Guest User

Untitled

a guest
Aug 9th, 2011
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement