Support » Fixing WordPress » pagination not working on custom template

  • Resolved laulief

    (@laulief)


    Hello there!

    I’m working on a website were I used selfmade templates. There are some templates on which I include a category. So, the posts are being loaded in a page.

    The problem I have is that no kind of pagination or standard navigation (next & previous post) is working. Not even something like this:

    <?php global $wp_query, $meta ,$paged;
    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query("paged=$page&cat=3");
    if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
    while ($wp_query->have_posts()) : $wp_query->the_post();
    ?>
    <?php endwhile ?>
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
    <?php $wp_query = null; $wp_query = $temp; ?>

    [Please post code or markup snippets between backticks or use the code button.]

    Does anybody know how to solve this?

    Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘pagination not working on custom template’ is closed to new replies.