New answers tagged

0

Instead of trying to do this through the orderby parameter, I went a different direction. Logically, the orderby parameter above only applies to the posts within each grouping, not the taxonomy term grouping itself so it won't work for this. What I ended up doing was adding 01, 02, 03, etc. to the taxonomy term name itself, then stripped that out using ...


0

Here is solution, split in arrays: <?php foreach (array_chunk(get_terms( 'razotajs', 'orderby=count&order=DESC&hide_empty=0&parent=0' ), 6, true) as $array) { echo '<div class="logo_sets">'; foreach($array as $cat) { ?> <a href="<?php ...


0

While this is not specifically WordPress but some general PHP, here's a solution which you could use: $terms = get_the_terms( $post->ID , 'prodcats' ); foreach( $terms as $term ) { $classes = 'categoryblock'; switch( $term->parent ) { case 3: $classes .= ' blue' // Notice the space between the opening string - important ...



Top 50 recent answers are included