help with archives...

Discussion in 'WordPress' started by mezner, Feb 17, 2011.

  1. #1
    Hey all, I'm having some difficulty with my archives page showing a "previous" posts link or anything like that. The code is showing the latest posts as well as limiting the number I want to show. The problem is, if there is more than the amount of posts on the page, how can I have a next button or something to show the other posts minus the first ones?

    <?php
    /*
    Template Name: Archive
    */
    ?>
    <?php get_header(); ?>
    <?php include(TEMPLATEPATH . '/banner.php'); ?>
    <div id="content">
    <div id="content_tp">
    <div class="wrap">
    			<?php $my_query = new WP_Query('category_name=&posts_per_page=3');
                        while ($my_query->have_posts()) : $my_query->the_post();
                        $do_not_duplicate = $post->ID;?>
    		                   
                     		<div class="post2">
                    	    <h3><?php the_title(); ?></h3>
    				<h4><?php the_time('l, F jS, Y') ?></h4>
                       	    <p><?php the_content_limit(200, "Read More") ?><p>
    			        </div>
    		<?php endwhile; ?>  
    		<div class="navigation">
            <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
            <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
            </div>
    <div class="clear"><!-- --></div>
            
    <?php include(TEMPLATEPATH . '/recommend.php'); ?>
            
            </div><!--wrap -->    
        
        </div><!--content_tp -->
        <div id="content_bt"><!-- --></div>
        </div><!--content -->
    
    </div><!--wrapper -->
    
    <?php get_footer(); ?>
    PHP:
     
    mezner, Feb 17, 2011 IP