php - How to show only the children in WordPress Categories? -


i have code wordpress , code displays entire category list. want make show categories' children category (not display "all").

right have:
category page 1
-child1
-child2

category page 2
-child1
-child2

for example want:
category page 1
-child1
category page 2
-child2

<!-- gallery filters --> <div id="gallery_filter">     <a href="<?php echo esc_url(get_page_link(df_get_page("gallery-1", false)));?>"<?php if(!$catslug) { ?> class="active"<?php } ?>><?php esc_html_e("all", theme_name);?></a>     <?php foreach ($categories $category) { ?>         <?php if(isset($category->term_id)) { ?>             <a href="<?php echo esc_url(get_term_link((int)$category->term_id,df_post_gallery.'-cat'));?>"<?php if($catslug==$category->slug) { ?> class="active"<?php } ?>><?php echo esc_html__($category->name);?></a>         <?php } ?>     <?php } ?> </div> 


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -