Main Page- Pagination not working
-
Hello everyone!
My main page, index.php has an area called “content” where it pulls posts, I wanted to add pagination so after 5 posts the user can click onto page 2…
How do we do this? here is the code on my main page<div id="content"> <?php $home_posts = cpotheme_get_option('cpo_home_limit'); if($home_posts == '' || !is_numeric($home_posts)) $home_posts = 5; query_posts('posts_per_page='.$home_posts); $post_count = 0; ?> <?php while(have_posts()): the_post(); ?> <div class="preview"> <div class="meta"> <div class="thumbnail"><?php the_post_thumbnail(array(300, 800)); ?></div> <div class="date"><?php the_date(); ?></div> <div class="tags"><?php cpotheme_post_tags(); ?></div> <div class="comments"><?php if(get_comments_number() == 1) _e('One Comment', 'cpotheme'); else printf(__('%1$s Comments', 'cpotheme'), number_format_i18n(get_comments_number())); ?></div> </div> <h2 class="title"> <a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'cpotheme'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a> </h2> <div class="byline"><?php cpotheme_post_shortbyline(); ?></div> <div class="content"><?php the_excerpt(); ?></div> </div> <?php endwhile; ?> <?php cpotheme_post_pagination(); ?> </div>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Main Page- Pagination not working’ is closed to new replies.