Support » Themes and Templates » Erro pagination wp_pagenavi – Didn't change the posts in the second page paginat

  • The list of the Posts not change the posts in the second page pagination

    I installed the plugin PageNavi, but when went for the second page, not show the content of the second page, did show the content of the first page again

    The code:

    <?php
    
    query_posts('cat=-8');
    if ( have_posts() ) :
    while ( have_posts() ) : the_post(); ?>
    
    <a href="<?php echo post_permalink() ?>">
    <?php
    if ( has_post_thumbnail() ) {
    
    the_post_thumbnail();
    
    } else {
    echo "<img class='pull-left' src='$url_image/imagemoff.png'>";
    }
    ?>
    
    </a>
    </div>
    
    <?php the_title() ?>
    <?php the_excerpt() ?>
    
    <?php
    endwhile;
    
    else :
    echo wpautop( '<div class="col-md-6"><p>Nenhuma notícia encontrada</p></div>' );
    endif;
    ?>
    
    <?php wp_pagenavi(); ?>

Viewing 1 replies (of 1 total)
  • Correct code

    <?php
    
    query_posts('cat=-8');
    if ( have_posts() ) :
    while ( have_posts() ) : the_post(); ?>
    
    <a href="<?php echo post_permalink() ?>">
    <?php
    if ( has_post_thumbnail() ) {
    
    the_post_thumbnail();
    
    } else {
    echo "<img class='pull-left' src='$url_image/imagemoff.png'>";
    }
    ?>
    
    </a>
    
    <?php the_title() ?>
    <?php the_excerpt() ?>
    
    <?php
    endwhile;
    
    else :
    echo wpautop( '<div class="col-md-6"><p>Nenhuma notícia encontrada</p></div>' );
    endif;
    ?>
    
    <?php wp_pagenavi(); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Erro pagination wp_pagenavi – Didn't change the posts in the second page paginat’ is closed to new replies.