Show more than one post in home.
-
I’m currently running wordpress 4.5 with a WooTheme called The Morning After. I decided to change a few things here and there, but encountered some issues regarding the posts_per_page argument used in the WP_query object. The intention is to show more than one post (3 or 4 posts) and ignore the category Featured articles.
$args = array('posts_per_page' => 1, 'category__not_in' => get_cat_ID('Featured articles')); $query = new WP_query('posts_per_page=1'); while ( $query->have_posts() ) { $query->the_post(); echo '<li>' . get_the_title() . '</li>'; break; } wp_reset_postdata();
What am I doing wrong? Result is just the latest non-Featured articles post.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Show more than one post in home.’ is closed to new replies.