• Resolved nickaster

    (@nickaster)


    Howdy, I’m sure this is simple but I’m still way behind the learning curve on understanding php.

    I messed around with some templates to create special author pages. Somehow, in doing so, the pagination of the pages got killed. Here’s what the core of the page looks like, including the part that’s supposed to produce pagination. Can anyone tell me what’s wrong? many thanks!

    <?php
    wp_reset_query();
    query_posts('author=107');
    
    if (have_posts()) : ?>
    		<div class="post" id="archiveh2">
    <h1 class="cca">Latest Posts...</h1>
    		</div>		
    
    		<?php while (have_posts()) : the_post(); ?>
    			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    					<div class="meta">
    						<h5><span class="author"><?php echo get_avatar( get_the_author_email(), '18' );?> Posted by <?php the_author_link(); ?> <?php the_time('F jS, Y'); ?></span> <span class="commentNum"><a href="<?php comments_link(); ?>" title="Comments on <?php the_title_attribute(); ?>"><img src="<?php bloginfo('template_url');?>/images/comment.png" /></a> <a href="<?php comments_link(); ?>" title="Comments on <?php the_title_attribute(); ?>"><?php comments_number('0 Comments', '1 Comment', '% Comments', '');?></a></h5>
    					</div>
    					<div class="entry">
    						<?php the_content('',FALSE,''); ?>
    						<p class="more"><img src="<?php bloginfo('template_url');?>/images/page_white_text.png" /> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> Read Full Article &raquo;</a> <img src="<?php bloginfo('template_url');?>/images/usergroup2-vi.gif" /> <a href="#">Discuss This &raquo;</a></p>
    					</div>
    				</div>
    
    		<?php endwhile; ?>
    			<?php if (show_posts_nav()) : ?>
    				<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>
    			<?php endif;?>
    	<?php else :
    
    		if ( is_category() ) { // If this is a category archive
    			printf("<h2 class='center'>Sorry, but there aren't any posts in the %s category yet.</h2>", single_cat_title('',false));
    		} else if ( is_date() ) { // If this is a date archive
    			echo("<h2>Sorry, but there aren't any posts with this date.</h2>");
    		} else if ( is_author() ) { // If this is a category archive
    			$userdata = get_userdatabylogin(get_query_var('author_name'));
    			printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", $userdata->display_name);
    		} else {
    			echo("<h2 class='center'>No posts found.</h2>");
    		}
    		get_search_form();
    
    	endif;
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • see if this fixes:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('author=107&showposts='.get_option('posts_per_page').'&paged=' . $paged);

    Thread Starter nickaster

    (@nickaster)

    Wow, incredible. It works. Thanks. \

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting Pagination to Work’ is closed to new replies.