Edited at

一覧ページのargsの設定まとめ

More than 3 years have passed since last update.

カテゴリ一覧

<?php 

$cat_now = get_the_category();

$args = array(
'post_type' => 'post',
'paged' => $paged ,
'cat' => $cat_now[0]->term_id,
'posts_per_page' => 4
);?>
<?php $the_query = new WP_Query( $args ); ?>
<?php if($the_query->have_posts()): ?>
<?php while($the_query->have_posts()): $the_query->the_post(); ?>

日付一覧(年月)

$year = get_query_var('year');

$monthnum = get_query_var('monthnum');
$args = array(
'post_type' => 'post',
'paged' => $paged ,
'year' => $year,
'monthnum' => $monthnum,
'posts_per_page' => 4
);
<?php $the_query = new WP_Query( $args ); ?>
<?php if($the_query->have_posts()): ?>
<?php while($the_query->have_posts()): $the_query->the_post(); ?>

http://notebook.yamamotohiroyuki.com/wordpress/2012/08/15/%E3%81%A1%E3%82%87%E3%81%84%E3%81%A1%E3%82%87%E3%81%84%E5%BF%98%E3%82%8C%E3%82%8B%E3%80%8Ewp_query%E3%80%8F%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9/

http://cthuwebdice.session.jp/wordpress/archive_php/

http://notnil-creative.com/blog/archives/1288