Pagination on static front page – WordPress

I have a static front page on my WP portfolio and have tried using the codex but can’t seem to figure out my loops. Here’s what my first query looks like:

<?php query_posts('category_name=portfolio&posts_per_page=4') ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?> 

Any idea what it would look like to paginate it on a static front page?

Related posts

Leave a Reply

2 comments

  1. Without any plugin you can use this (just a simple example)

    $paged = (get_query_var('page')) ? get_query_var('page') : 1;
    $args=array('category_name'=>'portfolio','posts_per_page'=>4,'paged'=>$paged);
    query_posts($args);
    if (have_posts()) : while (have_posts()) : the_post();
    /...
    endwhile;
    posts_nav_link();
    wp_reset_query();
    endif;
    

    Visit Codex to know more about formating links.

    Alternatively you can use plugins like pagenavi (I use this) or infinite scroll. There is also a nice tutorial if you manually want to build your infinite scroll.