• 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&amp;paged=$page"); while ( have_posts() ) : the_post() ?>
    
    ?php
    			 if(get_query_var('paged')=='2'){
    			 echo '<a href="/">&laquo; Accueil</a> | ';
    			 next_posts_link('Page Suivante &raquo;');
    			 }else{
    			 posts_nav_link(' | ', '&laquo; Page Précédente', 'Page Suivante &raquo;');
    			 }
    			 ?>

    Thanks for your time!

  • The topic ‘Displaying blogs on a page’ is closed to new replies.