Page Navigation for list of post

After getting help from ghost toast… I am almost seeing the light of day with this issue. Using this code I have been able to have a query of post show. However I am unable to figure out how to code it to work with the navigation. Thanks Ghost!

<?php while (have_posts()) : the_post(); ?>

    <div class="post" id="post-<?php the_ID(); ?>">
        <p class="post-date">
            <span class="date-day"><?php the_time('j') ?></span>
            <span class="date-month"><?php the_time('M') ?></span>
        </p>
        <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

        <div class="entry">
            <?php the_excerpt(); ?>

 </div>
   <p class="metadata">Posted by <?php the_author() ?>.<?php edit_post_link('Edit', ' |     
', ''); ?></p>
    </div>


<?php endwhile; endif; ?>

      <?php
global $wp_query;

$query = new WP_Query( 'cat=1' );

 $big = 999999999; // need an unlikely integer

 echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages
) );
?>

Related posts

1 comment

  1. Not sure about all the other custom stuff you’re running in there. But looks like you have taken a few tutorials and maybe mashed them together. I think something simple like this might work for you, then you can add some bells and whistles or try for paged navigation later. This will get you regular old Previous and Next links, which you indicated would satisfy your needs for now:

    <?php 
    if(have_posts()):
        while (have_posts()) : the_post();
        ?>
            <article id="post-<?php the_ID(); ?>" class="blog-object">
                <h2 class="blog-title">
                    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
                </h2>
    
                <div class="blog-entry-meta">
                    <small><?php the_time('F jS, Y'); ?></small>
                </div>
                <?php the_content();?>
            </article>
        <?php 
        endwhile;
    endif;
    ?>
    <div class="navigation">
        <span class="older"><?php next_posts_link('« Older') ?></span>
        <span class="newer"><?php previous_posts_link('Newer »') ?></span> 
    </div><!-- .navigation -->
    

    Feel free to modify that to accomodate other elements you want, such as author meta.

Comments are closed.