$paged, //「現在のページ番号」はここでも指定する
'posts_per_page' => 5,
/* その他のプロパティの指定など... */
'post_status'=>'publish',
'post_type' => 'news',
);
$the_query = new WP_Query( $args );
?>
have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post();
$num++;
?>
-
have_posts() ) :
$num = 0;
while ( $the_query->have_posts() ) : $the_query->the_post();
$num++;
$title;
if(mb_strlen($post->post_title)<=22){
$title = $post->post_title;
}else{
$title = mb_substr( $post->post_title, 0,22) .'...';
}
?>
-
max_num_pages, $paged ,$url); //$wp_query ではなく $the_query ないことに注意!
endif;
wp_reset_postdata();
?>