Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Please, someone can help?! I'm fighting with this for weeks and nothing.... I'm quite new in wordpress and php...

There is a way to list taxonomy terms based on another taxonomy? OR If is possible to list taxonomies based on post category.

BUT, I'm doing this on homepage, not post page...

The function above retrieve my all my taxonomy terms, but how or where filter this?

function dox_get_list_terms( $taxonomy = 'category', $term_id, $number, $orderby = 'ID', $order = 'ASC', $hide = '0' ) {        

        global $dox_options;

        $terms = array();
        $terms = explode(',', $term_id);
        $count = count( $terms );

        $output = '';
        foreach( $terms as $term ) {
            if ($term >= 0) {
                $options = get_terms( $taxonomy, 'number='.$number.'child_of='.$term.'&parent='.$term.'&hide_empty='.$hide.'&hierarchical=1&depth=1&orderby='.$orderby.'&order='.$order );
                if (! is_wp_error($options) ) {
                    foreach ($options as $option) {
                        $output .= '<li>'. $option->name .'</li>';
                        }
                    }
                }
            }
        }

        return $output;
}
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

If you are trying to print children of a category, this should be sufficient:

<?php wp_list_categories('orderby=id&show_count=1&use_desc_for_title=0&child_of='.$term_id); ?>

Details here: http://codex.wordpress.org/Template_Tags/wp_list_categories

share|improve this answer
    
Thanks Kakoma, this could open my mind and I resolved with your help! –  Santoro Jun 13 '12 at 9:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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