Support » Plugins and Hacks » WP-PageNavi » [Plugin: WP-PageNavi] Pages and custom query

[Plugin: WP-PageNavi] Pages and custom query

  • I am having troubles getting this to work..

    When I click page 2, the same entries as in “page 1″…

    <?php if (have_posts()) : ?>
                    <?php $post = $posts[0]; $c=0;?>
                    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    				query_posts( array( 'paged' => get_query_var('paged') ) );
                    //query_posts('author_name=admin&posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);
    				query_posts('posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);?>
    				<?PHP //query_posts ( 'author_name=admin' ); ?>
                    <?php while (have_posts()) : the_post(); ?>
    				<?php $c++; if( $c == 1) :?>
                    <?php $i = 1; ?>
                        <!-- start entry post -->

    And in the end of the page i have this:

    <div class="navigation">
                        <?php wp_pagenavi(); ?>
                        <!--<div class="alignright"><?php //next_posts_link('Tidigare inlägg &raquo;') ?></div>
                        <div class="alignleft"><?php //previous_posts_link('&raquo; Senare inlägg') ?></div>-->
                    <?php wp_reset_query(); ?>
                    <br />


Viewing 2 replies - 1 through 2 (of 2 total)
  • You should actually _never_ use query_posts (ask Nacin, he had a great presentation about that on the last WordCampNL). Try using the WP_Query class instead.

    @Hirnathi you are correct…but that doesn’t help with the issue.

    Please can someone respond. I *am* using Wp_Query but the same thing is happening as described by @soulgod.

    Can anyone help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP-PageNavi] Pages and custom query’ is closed to new replies.
Skip to toolbar