May 30, 201115 yr Hi, I'm currently working on my portfolio site on www.ben-gibson.co.uk I'm stuck creating working blog pages for my blog. In short what i want is to display 3 blog posts per page. I currently have working older posts and new posts buttons which re-direct but they just display the same blog posts on each page . I have seen similar problems and the suggest solution was to set the homepage as static in your WordPress dashboard and you blog page as the page that will display you blog. However my homepage is not static as it shows recent blog posts. I have seen a number of WordPress sites which have a home page witch displays recent blog posts as well as a separate blog page organized with working pages I'm just not sure how its done. Thanks for any help
June 1, 201115 yr Author Post the code you're using for that loop! Here the code im using <?php query_posts('category_name=blog&posts_per_page=3'); ?> <?php while (have_posts()) : the_post(); ?> <div id="blog-wrap"> <div class="blog-post"> <div class="blog-image"> <a href="#"> <?php the_post_thumbnail(); ?> </a> </div> <div class="blog-text"> <h3 class="blog-post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <span class="blog-details"><?php the_time('F j Y'); ?></span> <span class="description post-meta-separator">/</span> <span class="blog-details"><?php comments_number('0 comments','1 comment','% comments'); ?></p></span> <div class="blog-info-description"> <?php the_excerpt(); ?> </div> </div> </div> </div> <?php endwhile; ?> <div id="prev-page"> <div class="button"> <?php previous_posts_link('Previous'); ?> </div> </div> <div id="next-page"> <div class="button"> <?php next_posts_link('Next'); ?> </div> </div>
June 1, 201115 yr Change: query_posts('category_name=blog&posts_per_page=3'); To: $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('category_name=blog&posts_per_page=3&paged='.$paged);
June 1, 201115 yr Author Change: query_posts('category_name=blog&posts_per_page=3'); To: $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('category_name=blog&posts_per_page=3&paged='.$paged); Perfect Thanks very much
Create an account or sign in to comment