Support » Fixing WordPress » 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:

    the code i have:

    // Include WordPress
    define('WP_USE_THEMES', false);
    query_posts( array ( 'cat=5', 'posts_per_page' => 1 ) );
    <?php while (have_posts()) : the_post(); ?>
    <?php the_title(); ?>
       <?php echo get_the_date( 'j F Y' ); ?>
    <?php the_content(); ?>
    <?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.

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