• Hi.

    I am having issues trying to view older posts on my website.

    Here is the URL.

    http://north-uist-medical.co.uk/wordpress/news-and-views/practice-news/

    I have used some code to enable posts to be made on two different pages on the site – ‘practice news’ and ‘clinical views.’

    When the posts get above the maximum display number ‘previous’ and ‘next’ appear at the bottom of the post – but they don’t work.

    I have searched the forums and found advice to add this code….

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
          query_posts("category_name=XXX&paged=$paged"); ?>

    But it does not seem to work for me or i am putting it in the wrong place?

    My code is…

    <div id="main">
    	<div id="content">
    
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    		<?php the_content(); ?>
    	<?php endwhile; else: endif; ?>
    <?php query_posts('category_name='.get_the_title().'&post_status=publish,future');?>
    
     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
            <small><?php the_time('F jS, Y') ?> by <?php the_author() ?>. </small>
    	<p><?php the_content(); ?></p>
    	<?php endwhile; else: endif; ?>
    
    		<?php posts_nav_link('','&laquo; previous','next &raquo;'); ?>
    	</div>

    I would be very grateful for any help.

  • The topic ‘Viewing older posts.’ is closed to new replies.