Title: next_posts_link outside main wordpress install
Last modified: August 20, 2016

---

# next_posts_link outside main wordpress install

 *  [voiddesign](https://wordpress.org/support/users/voiddesign/)
 * (@voiddesign)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/next_posts_link-outside-main-wordpress-install/)
 * hello wordpress geniuses,
 * can’t for the life of me figure out how to get this to work. in english, here’s
   what i’d like to do:
    -query all posts in one category -display only one post-
   create previous/next links that shift from post to post within the category. 
   link to the website: [http://nhkw.net/testnext.php](http://nhkw.net/testnext.php)
 * the code i have:
    ` <?php // Include WordPress define('WP_USE_THEMES', false);
   include('updates/wp-load.php'); query_posts( array ( 'cat=5', 'posts_per_page'
   => 1 ) ); ?> ... <?php while (have_posts()) : the_post(); ?> <h1> <?php the_title();?
   > </h1> <h2>    <?php echo get_the_date( 'j F Y' ); ?> </h2> <h3> <?php the_content();?
   > </h3> <?php endwhile; ?>
 * <?php previous_post_link('%link','%title'); ?>
    <?php next_post_link('• %link','%
   title'); ?>
 * as you can see, the link just spits out a literal link, which doesn’t exist since
   i’m not really “inside” a wordpress install, i’m just sucking data out.
 * would the best way to do this be to make a function that concatenates a new $
   query_string each time and then reload the page with the new query?
 * i just KNOW there’s a stupidly easy way to do this that i can’t figure out. any
   and all help/advice/chiding appreciated.
    -sam

The topic ‘next_posts_link outside main wordpress install’ is closed to new replies.

## Tags

 * [next](https://wordpress.org/support/topic-tag/next/)
 * [next_post_link](https://wordpress.org/support/topic-tag/next_post_link/)
 * [Outside The Loop](https://wordpress.org/support/topic-tag/outside-the-loop/)
 * [previous](https://wordpress.org/support/topic-tag/previous/)
 * [previous_post_link](https://wordpress.org/support/topic-tag/previous_post_link/)
 * [single post](https://wordpress.org/support/topic-tag/single-post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [voiddesign](https://wordpress.org/support/users/voiddesign/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/next_posts_link-outside-main-wordpress-install/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
