0

Why doesn't it shows terms in both 'lunch' and 'dinner' taxonomies?
How can i do it?

  <?php 
    $taxonomy     = array('lunch', 'dinner');
    $orderby      = 'name'; 
    $hierarchical = 1; 
    $title        = '';

    $args = array(
      'taxonomy'     => $taxonomy,
      'orderby'      => $orderby,  
      'hierarchical' => $hierarchical,
      'title_li'     => $title
    );
    ?>

    <ul>
    <?php wp_list_categories( $args ); ?>
    </ul> 

1 Answer 1

0

Have you noticed in the list all of valid Parameters for wp_list_categories() function that taxonomy doesn't accept input as array, thats why you are not supposed to pass an array to it.

If you still want to be able to show terms of two different taxonomies, use get_terms() Wordpress function instead. The only bad is it won't provide pre-formatted list of Term Objects and their children, instaed it provides array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.