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.phpthe 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.