function change_posts_per_page($query) { if ( is_admin() || ! $query->is_main_query() ) return; if ( $query->is_tax( 'タクソノミー名' ) ) { $query->set( 'posts_per_page', '6' ); } } add_action( 'pre_get_posts', 'change_posts_per_page' );
【WP】taxonomy.phpで表示件数を制御
2020.9.7
コメント