Listing only 1 level of subcategories?

0 replies
**Sorry about the title, my question changed when I was typing it all out and I forgot to switch the title before posting**


I'm new to creating Wordpress themes and I'm having a problem while trying to display subcategories of a subcategory. I want display the name of the subcategories that are located within the parent . The method I'm using now displays the category title correctly, but it lists it for every post that's in the parent. So I have duplicated category titles within my list. I'm sorry I can't provide a link (locally testing right now using xampp). I will try to explain a little more clearly.



Code I'm using:
PHP Code:
<?php 

                     
= array(
                        
'child_of' => 14,
                        
'title_li' => __(''),
                    );

                
?>        
                
                <?php
                
                
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                
                    
                    <div class="box">
                        <ul class="cattable">
                             <li ><?php wp_list_categories(); ?>     </li>    
                        </ul>    
                        
                    </div>    
                <?php endwhile; else: ?>
                <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
                <?php endif; ?>
#level #listing #subcategories

Trending Topics