0

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;
}
0

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

  • Thanks Kakoma, this could open my mind and I resolved with your help! – Santoro Jun 13 '12 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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