$posts = get_posts(array('posts_per_page' => 10,));
これだと10だが、毎回は面倒(´・ω・) ス
get_postsの配列内、posts_per_pageの値を
get_option(‘posts_per_page’) とすればおk
$posts = get_posts(array('posts_per_page' => get_option('posts_per_page')));
見やすく書くと
$args = array( 'posts_per_page' => get_option('posts_per_page'), ); $posts_array = get_posts( $args );
<?php $args = array( 'posts_per_page' => 5, 'offset' => 0, 'category' => '', 'category_name' => '', 'orderby' => 'date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'author' => '', 'post_status' => 'publish', 'suppress_filters' => true ); $posts_array = get_posts( $args ); ?>