<?php if (get_field('first', 'taxonomy_' . $term_info->term_id)) { $categories = get_terms('taxonomy','orderby=order&order=ASC&hide_empty=0&child_of=' . $term_info->term_id); $count = 1; foreach ( $categories as $cat ) { if (get_field('second', 'taxonomy_' . $cat->term_id)) { ?><li<?php if ( $count % 3 == 0 ) { echo ' class="last"'; } ?>><a href="<?php echo get_term_link( $cat, taxonomy ); ?>" title="<?php echo $cat->name; ?>"><?php echo $cat->name; ?></a></li><?php $count++; } } ?> <?php } else { $categories = get_terms('taxonomy','orderby=order&order=ASC&hide_empty=0&child_of=' . $term_info->term_id); $count = 1; foreach ( $categories as $cat ) { ?><li<?php if ( $count % 3 == 0 ) { echo ' class="last"'; } ?>><a href="<?php echo get_term_link( $cat, taxonomy ); ?>" title="<?php echo $cat->name; ?>"><?php echo $cat->name; ?></a></li><?php $count++; } } ?>
http://web-taiyo.com/works/131019.html