WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi not working on Custom page Template. (2 posts)

  1. swadeshib
    Member
    Posted 2 years ago #

    this is my code in Custom page Template

    <?php query_posts('showposts=8'); ?>
    <?php
    $count = 1;
    if (have_posts()) : while (have_posts()) : the_post(); if($count == 1) : ?>

    & this is wp_pagenavi code

    <div class="more_entries">
    <?php if (function_exists('wp_pagenavi')) wp_pagenavi(); else { ?><?php } ?></div>
    </div>

    page numbers showing but navigation not working

    i tried this code but not working

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
     query_posts(array(
       'posts_per_page' => 8,
       'paged' => $paged
      )
     );?>

    http://pastebin.com/pt7aD7pu

  2. swadeshib
    Member
    Posted 2 years ago #

    thanks i solved the bug

    by

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array (	'posts_per_page' => '8'
    ); query_posts($args . '&paged=' . $paged); ?>

    <?php $count = 1; if (have_posts()) : while (have_posts()) : the_post(); if($count == 1) : ?>

Topic Closed

This topic has been closed to new replies.

About this Topic