<php $args = array('posts_per_page' => 2,
'orderby' => 'date',);$posts_array = get_posts( $args );if (!empty($posts)):>

<php foreach($posts_array as $post):setup_postdata($posts_array);>
<a href="<php echo get_permalink();>"><div class="img-wrap">
画像
<php if ( has_post_thumbnail()){
//存在
the_post_thumbnail();}
else {
//存在しない
echo '<img src="noimage.jpg">';}></div>
タイトル
<h2><php the_title(); ></h2>
日付け
<php the_time('Y/m/d');>
カテゴリー
<php $categories = get_the_category();if ( $categories ) {echo '<ul>';
foreach ( $categories as $category ) {echo '<li class="cat1"'.$category->slug.'"><a href="'.esc_url(get_category_link($category->term_id)).'">'.$category->name.'</a></li>';}
echo '</ul>';}>
コメント数
<php $num_comments = get_comments_number();if ( $num_comments == 0 ) {$comments = __('No Comments');
} elseif ( $num_comments > 1 ) {$comments = $num_comments . __(' Comments'); } else {$comments = __('1 Comment');
$write_comments = '<span class="singlecomments"><a href="' . get_comments_link() .'">'. $comments.'</a></span>';echo $write_comments;>
コメントの抜粋
<php the_excerpt();>
記事を読む
<a href="<php the_permalink();>">記事を読む</a> <php endforeach;>
<php else:>
<div class="newarrival_nodata"><p>記事</p></div>
<php endif;wp_reset_postdata();>
ページナビを実装したいんですが、$nextpostと$prevpostを使って2ページ目を表示させる場合どういうコードを書けばよいのでしょうか?