Category Order and Taxonomy Terms Orderを使うとget_tags()の並び替えが効かなくなる Category Order and Taxonomy Terms Orderを使った際、get_tags()の並び順(orderby)がidから変更できなくなったので対応方法をメモしておきます。 サンプルコード get_tags()でタグの一覧を表示させてみます。 PHP <?php $tags = get_tags(); if( $tags ): ?> <ul> <?php foreach( $tags as $tag ): ?> <li> ID:<?php echo esc_attr( $tag->term_id ); ?> 名前:<?php echo esc_html( $tag->name ); ?> </li> <?php endforeach;
![Category Order and Taxonomy Terms Orderを使うとget_tags()の並び替えが効かなくなる](https://cdn-ak-scissors.b.st-hatena.com/image/square/e53b6774d6bf3e6ebbdf6ce6608011deafa02f1f/height=288;version=1;width=512/https%3A%2F%2Fcly7796.net%2Fblog%2Fwp-content%2Fuploads%2F2017%2F04%2Forder.jpg)