Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1.  <?php
  2.  
  3.                     $taxonomy     = 'category';
  4.                     $orderby      = 'name';
  5.                     $show_count   = 0;
  6.                     $pad_counts   = 0;
  7.                     $hierarchical = 1;
  8.                     $title        = '';
  9.                     $empty        = 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.                     );
  20.                     $all_categories = get_categories( $args );
  21.  
  22.  
  23.                        
  24.                         foreach ($all_categories as $cat) {
  25.                             if($cat->category_parent == 0) {
  26.                                 $category_id = $cat->term_id;
  27.  
  28.  
  29.                                     ?>
  30.                                     <?php if( $cat->slug != 'sem-categoria' ): ?>
  31.                                    
  32.                                         <?php echo $cat->name; ?>
  33.                                  
  34.                                     <?php
  35.                                     endif;
  36.  
  37.                             }
  38.                         }
  39.  
  40.                 ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement