Pagination not working with custom loop
I'm creating a custom page for logged in current users to view their posts. I would like to limit the number of displayed post to 5, but cannot get pagination to display.
This is what I'm using:
<?php if ( is_user_logged_in() ): global $current_user; get_currentuserinfo(); $author_query = array('posts_per_page' => '5','author' => $current_user->ID); $author_posts = new WP_Query($author_query); while($author_posts->have_posts()) : $author_posts->the_post(); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> <?php endwhile; else : echo "not logged in"; endif; ?>
I'm by no means professional, just enjoy creating my own sites, and so I be making a very silly nooby mistake. Please be gentle with me? Thank you for your help!