• Hiya, I’m working on a single post where I want to show a single post, and in the right colom a list with the latest 5 posts. under these post’s I want a next five posts navigation.

    The showing of the single post and the latest five posts in the right colom works but The navigation does not link to the next 5 posts but it show the same five.

    This is my code:

    <div id=”news_left”>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <h1><?php the_title(); ?></h1>
    <p><?php the_content(); ?></p>

    <?php endwhile; else: ?>
    <p> There is no content </p>
    <?php endif; ?>
    </div>
    <div id=”news_right”>

    <?php
    $temp = $wp_query;
    $wp_query = null;
    $wp_query = new WP_Query();
    $wp_query->query(‘category_name=news&showposts=5′.’&paged=’.$paged); ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <h2>” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>
    <div id=”custom_img”><?php custom_field_image(); ?></div>
    <div id=”intro_tekst”><span><?php the_time(‘m-y’); ?></span>
    <?php the_excerpt(); ?>
    </div>
    <?php endwhile; ?>
    <div class=”nav”><?php previous_posts_link(‘« Previous’) ?><?php next_posts_link(‘More »’) ?></div>

    <?php $wp_query = null; $wp_query = $temp;?>

    </div>

    I quite stuck on this I hove you guys can help me.

    Thx Jacob

  • The topic ‘Single post page naviagation not working’ is closed to new replies.