johnbergson

Customizr show subcategories in parent category

Aug 4th, 2014
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.70 KB | None | 0 0
  1. <?php do_action( '__before_main_wrapper' ); ##hook of the header with get_header ?>
  2. <div id="main-wrapper" class="<?php echo tc__f( 'tc_main_wrapper_classes' , 'container' ) ?>">
  3.  
  4.     <?php do_action( '__before_main_container' ); ##hook of the featured page (priority 10) and breadcrumb (priority 20)...and whatever you need! ?>
  5.    
  6.     <div class="container" role="main">
  7.         <div class="<?php echo tc__f( 'tc_column_content_wrapper_classes' , 'row column-content-wrapper' ) ?>">
  8.  
  9.             <?php do_action( '__before_article_container'); ##hook of left sidebar?>
  10.                
  11.                 <div id="content" class="<?php echo tc__f( '__screen_layout' , tc__f ( '__ID' ) , 'class' ) ?> article-container">
  12.                    
  13.                 <?php
  14.                     get_header();
  15.                     // get current category
  16.                     $current_cat = get_category(get_query_var('cat'), false);
  17.                     // set args for wp_list_categories
  18.                     $args = array(
  19.                         'child_of' => $current_cat->term_id,
  20.                         'hide_empty' => 0,
  21.                         'hierarchical' => true,
  22.                         'depth'  => 1,
  23.                         'title_li' => '',
  24.                     );
  25.                     wp_list_categories($args);
  26.                 ?>
  27.  
  28.                 </div><!--.article-container -->
  29.  
  30.            <?php do_action( '__after_article_container'); ##hook of left sidebar ?>
  31.  
  32.         </div><!--.row -->
  33.     </div><!-- .container role: main -->
  34.  
  35.     <?php do_action( '__after_main_container' ); ?>
  36.  
  37. </div><!--#main-wrapper"-->
  38.  
  39. <?php do_action( '__after_main_wrapper' );##hook of the footer with get_get_footer ?>
Advertisement
Add Comment
Please, Sign In to add comment