Title: WP_Query help
Last modified: August 19, 2016

---

# WP_Query help

 *  Resolved [goldmember](https://wordpress.org/support/users/goldmember/)
 * (@goldmember)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/wp_query-help-1/)
 * on [this page](http://onlycornerstone.com.previewdns.com/new-furniture-arrivals/)
   i’m using the code below to show the 25 most recent posts from category 4.
 *     ```
       <?php
       $custom_query = new WP_Query( 'posts_per_page=25&cat=4' );
       if ( $custom_query->have_posts() ) : while ( $custom_query->have_posts() ) : $custom_query->the_post(); ?>
   
       <h3><?php the_title(); ?></h3>
       <h6><?php the_time('F j, Y') ?></h6>
       <?php the_content(); ?>
       <hr class="homenews" />
       <?php previous_posts_link('« Older Entries', 0) ?>
       <?php endwhile; else : ?>
   
       <h3>Sorry...</h3>
       <p>No posts were found.</p>
   
       <?php endif; ?>
       ```
   
 * i thought this line of code `<?php previous_posts_link('« Older Entries', 0) ?
   >` would add a link to the bottom of the page that shows a link to previous entries
   but for some reason the link does not appear.
 * please advise how I can get it to show. thanks in advance

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/wp_query-help-1/#post-1953412)
 * I think you need to use query_posts() instead of WP_Query and add the ‘paged’
   argument to the query.
 *  Thread Starter [goldmember](https://wordpress.org/support/users/goldmember/)
 * (@goldmember)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/wp_query-help-1/#post-1953429)
 * based on what i read in another thread where they addressed this same issue, 
   I would think the code below would work.
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * but if you look on [the page](http://onlycornerstone.com.previewdns.com/test/)
   where i’m testing this code, i’m getting a parse error message.
 * please advise. thanks.

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

The topic ‘WP_Query help’ is closed to new replies.

## Tags

 * [previous_posts_link](https://wordpress.org/support/topic-tag/previous_posts_link/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [goldmember](https://wordpress.org/support/users/goldmember/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/wp_query-help-1/#post-1953429)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
