'post',
'post_status' => 'publish', // 非公開時期の投稿がキャッシュされないように
'no_found_rows' => true,
'ignore_sticky_posts' => 1,
'meta_key' => SWELL_CT_KEY,
'orderby' => 'meta_value_num',
'order' => 'DESC',
];
if ( ! empty( $exc_tag ) ) {
$q_args['tag__not_in'] = $exc_tag;
}
SWELL_Theme::get_parts( 'parts/post_list/loop_sub', [ 'query_args' => $q_args ] );
?>
'post',
'post_status' => 'publish', // 非公開時期の投稿がキャッシュされないように
'no_found_rows' => true,
'ignore_sticky_posts' => 1,
'tax_query' => [
[
'taxonomy' => $t['tax'],
'field' => 'id',
'terms' => [ $t['id'] ],
'operator' => 'IN',
'include_children' => true,
],
],
];
if ( ! empty( $exc_tag ) ) {
$q_args['tag__not_in'] = $exc_tag;
}
// 投稿数を取得したいので、ここでWP_Query生成
$the_query = new WP_Query( $q_args );
$the_query_count = $the_query->post_count;
// 投稿リスト
SWELL_Theme::get_parts( 'parts/post_list/loop_sub', [ 'query' => $the_query ] );
// MORE ボタン
$cat_url = get_term_link( $t['id'], $t['tax'] );
$has_more_posts = get_option( 'posts_per_page' ) < $t['count'];
if ( $has_more_posts && $cat_url ) :
$page2_url = false === strpos( $cat_url, '/?' ) ? $cat_url . '/page/2/' : $cat_url . '&paged=2';
$page2_url = str_replace( '//page', '/page', $page2_url );
?>