Advertisement
Guest User

Untitled

a guest
Aug 10th, 2011
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 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.     $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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement