Lo hice generando varias listas de términos. Lo llamo más tarde por mi propia orden. Soy un principiante de PHP.
En primer lugar, almacenar, en una variable diferente, el ID para cada término categoría:
$terms = get_terms('my_taxonomy', 'hide_empty=0');
foreach ($terms as $term) {
${$term->slug} = get_term_by('slug', $term->slug, 'product_cat');
${$term->slug.'_array'} = (array)${$term->slug};
${$term->slug.'_array_id'} =${$term->slug.'_array'}['term_id'];
};
Entonces, crear varios argumentos para cada wp_list_categories()
excluidos, con esta variable los términos que quieren:
$args = array(
'taxonomy' => 'my_taxonomy',
'orderby' => 'name',
'show_count' => true,
'pad_counts' => false,
'hierarchical' => true,
'title_li' => '',
'hide_empty' => 0,
'show_option_all' => 'Show all',
'exclude' => array($term1_array_id, $term2_array_id)
);
$args_1 = array(
'taxonomy' => 'my_taxonomy',
'orderby' => 'name',
'show_count' => true,
'pad_counts' => false,
'hierarchical' => true,
'title_li' => '',
'hide_empty' => 0,
'exclude' => array($term3_array_id, $term4_array_id, $term1_array_id)
);
$args_2 = array(
'taxonomy' => 'my_taxonomy',
'orderby' => 'name',
'show_count' => true,
'pad_counts' => false,
'hierarchical' => true,
'title_li' => '',
'hide_empty' => 0,
'exclude' => array($term1_array_id, $term4_array_id, $term5_array_id)
);
Por último, puedo llamar por separado cada lista plazo:
<ul>
<?php wp_list_categories($args); ?>
<?php wp_list_categories($args_1); ?>
<?php wp_list_categories($args_2); ?>
</ul>
wow realmente, ¿Puede haber algo más hacky entonces esto? – Tosh