Display taxonomy depth differently
-
Hello,
I’m trying to display the taxonomy children differently from the mother taxonomy.
I have this taxonomy called “auteur”, and inside I have A, B, C, D… and inside each the authors. I want to make a taxonomy template letting me display for the first depth just A, B, C, D… and for depth 2 the children categories. I have<?php //list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin) $taxonomy = 'Auteur'; $orderby = 'name'; $show_count = 0; // 1 for yes, 0 for no $pad_counts = 0; // 1 for yes, 0 for no $hierarchical = 1; // 1 for yes, 0 for no $title = ''; $depth = 1; $top_level_arg = array( 'taxonomy' => $taxonomy, 'orderby' => $orderby, 'show_count' => $show_count, 'pad_counts' => $pad_counts, 'hierarchical' => $hierarchical, 'title_li' => $title, 'depth' => $depth ); ?> <?php if (is_taxonomy( $top_level_arg)) : ?> <p>Show A, B, C...</p> <?php else : ?> <p>Show the autors names</p> <?php endif; ?>
I don’t know what’s wrong with the code. Can someone help me please ?
Thank you very much. This is the page I’m working on : https://www.tiwelle.com/visagevert/auteur/a/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Display taxonomy depth differently’ is closed to new replies.