Title: query_posts() problems on a page
Last modified: August 20, 2016

---

# query_posts() problems on a page

 *  Resolved [r4fay](https://wordpress.org/support/users/r4fay/)
 * (@r4fay)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problems-on-a-page/)
 * Hello. I’m new here as well as new to WordPress. I’m having a bit of a problem
   here, I’ll try to explain.
 * I’m using WordPress as a CMS. I want to display blog posts on a “page” rather
   than the default. So, I’ve my page created titled “blog” which I’m using as a
   placeholder for the blog posts, as stated in the Codex. Now, in the blog.php 
   file (in-charge of displaying posts) I’m using query_posts() post function.
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * I’ve posted 8 gibberish posts at the moment. The problem is, **when I click the
   the “older entries” (<?php next_posts_link ?>), it still displays 5 posts rather
   than displaying the remaining 3 of the them.**
 * So, any suggestions on how to fix this issue? Any help would be deeply appreciated.
 * Thnkas

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problems-on-a-page/#post-2133417)
 * the custom query probably needs to use the pagination parameter;
    try:
 *     ```
       <?php query_posts("posts_per_page=5&paged=".get_query_var('paged')); ?>
       ```
   
 * [http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters)
 *  Thread Starter [r4fay](https://wordpress.org/support/users/r4fay/)
 * (@r4fay)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problems-on-a-page/#post-2133418)
 * Never mind guys. I found the solution by searching a little more on the web. 
   If any of you is wondering how I did this, here’s the method. [How to create a separate page for blog posts in wordpress](http://www.wpbeginner.com/wp-tutorials/how-to-create-a-separate-page-for-blog-posts-in-wordpress/)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘query_posts() problems on a page’ is closed to new replies.

## Tags

 * [page](https://wordpress.org/support/topic-tag/page/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [problem](https://wordpress.org/support/topic-tag/problem/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)
 * [showing](https://wordpress.org/support/topic-tag/showing/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [r4fay](https://wordpress.org/support/users/r4fay/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problems-on-a-page/#post-2133418)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
