taxonomy.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $page_object = get_queried_object(); $args = array( 'post_type' => '投稿タイプ名', 'orderby' => 'date', 'order' => 'desc', 'post_status' => 'publish', 'paged' => $paged, 'taxonomy' => $page_object->taxonomy, 'term' => $page_object->slug, 'posts_per_page' => 10 ); $my_query = new WP_Query($args); <?php if ($my_query->have_posts()):?> <?php while( $my_query->have_posts()): $my_query->the_post(); ?> ・・・ <?php endwhile;?> <?php endif;?> <?php wp_reset_postdata();?> |
コメント