• I wrote this code in category.php:

    if(have_posts()) :
            while(have_posts()) : the_post();
    ?>
    
        
            <div class="card-post">
                
                <?php the_post_thumbnail(); ?>
                <span><?php the_date(); ?></span>
                <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
    
                <div class="btn-azul"><a href="<?php the_permalink(); ?>" >Leia mais</a></div>
            </div>
        <?php
                endwhile;?>
             </div>
        <?php
    
                echo paginate_links();
       
            else:
                echo "Nenhum post foi encontrado";
            endif;
        ?>

    But nothing is showing on page ?? Please, help me …

    • This topic was modified 4 years, 6 months ago by jlucasme.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    The code you posted works fine when I tested it on my site. When you say “nothing showing”, do you mean a blank white screen or do you get “Nenhum post foi encontrado”?

    If white, define WP_DEBUG as true in wp-config.php and check the page again for error messages.

    If “Nenhum post foi encontrado”, add to the top:

    echo '<pre>';
    global $wp_query;
    echo $wp_query->request, '</pre>';

    which will output the SQL query used. Something in the WHERE clause is preventing anything from being found.

    Thread Starter jlucasme

    (@jlucasme)

    My blog had no posts rs, i didnt know that wordpress verify if has or not enough posts to show the paginate.
    I’m sorry, but thanks by the answer <3

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with Pagination on loop’ is closed to new replies.