Displaying blogs on a page
-
I would really appreciate the help on this one.
I have a page_blog.php that is job to fetch news from the database and display them by date. I have tweaked the code a little bit so that I can skip the first 4 articles (because they are being posted on the mainpage) once skipped, it’ll start displaying 8 articles per page.
The problem is, when I click on “next page”, it takes me to /page/3 but the articles are staying the same, what I really want is the articles to change in the next page as well.
This is my code
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("showposts=4&paged=$page"); while ( have_posts() ) : the_post() ?> ?php if(get_query_var('paged')=='2'){ echo '<a href="/">« Accueil</a> | '; next_posts_link('Page Suivante »'); }else{ posts_nav_link(' | ', '« Page Précédente', 'Page Suivante »'); } ?>
Thanks for your time!
- The topic ‘Displaying blogs on a page’ is closed to new replies.