Restoration
11/11/2016 - 12:10 PM

QueryPostを使った更新情報

QueryPostを使った更新情報

<h2>更新情報</h2>
<?php query_posts($query_string . 'showposts=5&cat=1,3'); ?>
<?php if (have_posts()) : ?>
	<dl>
		<?php while (have_posts()) : the_post(); ?>
			<dt><?php the_time('Y-m-d') ?></dt>
			<dd>[ <?php the_category(', ') ?> ]
			<a href="<?php the_permalink() ?>"><?php the_title(); ?></a></dd>
		<?php endwhile; ?>
	</dl>
		<?php else : ?>
		<p>更新情報はありません</p>
<?php endif; ?>
<?php query_posts($query_string . ""); ?>