• Resolved cimenta

    (@cimenta)


    hi

    where in the code below I should place wp_pagenavi(); to make it work?

    Thank you

    R.

    function list_all_posts() {
    if (is_page('video')) {
      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      $args=array(
        'orderby' => 'date',
        'order' => 'DESC',
        'category_name' => 'blog',
        'posts_per_page' => 3,
        'post_status' => 'publish',
        'paged' => $paged,
      );
      $archive_query = new WP_Query($args);
      echo "<ul>\n";
      while ($archive_query->have_posts()) :     $archive_query->the_post();
        echo '<li><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . "</a></li>\n";
      endwhile;
      echo "</ul>\n";
      wp_pagenavi();
      wp_reset_query();
      }
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cimenta

    (@cimenta)

    I tried to place wp_pagenavi(); anywhere in my code but it did not help …

    Thread Starter cimenta

    (@cimenta)

    I made it work by add

    $temp = $wp_query;  // assign orginal query to temp variable for later use
    global $wp_query;
    global $post;

    so it looks like it has nothing to do with

    wp_pagenavi()

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP-PageNavi] where to place wp_pagenavi(); in custome loop?’ is closed to new replies.