the_posts_navigation is not working

Question

Unfortunately, the_posts_navigation() function is not working for me. When I click on ‘Older Posts’ it’s showing ‘404 page I don’t know why my code is not working.

Here is the code –

<div class="row">
    <?php while ( have_posts() ) : the_post(); ?> 
    <div class="col-md-3 thumbnailu">
        <a class="thmb" href="<?php echo get_post_meta ($post->ID, 'link_name', true); ?>" target="_blank">
        <?php 
        the_post_thumbnail( 'website-image-size', array( 'class' => 'img-responsive' ) ); 
    ?>

        <p class="caption"><?php the_title(); ?><br> 
        by <?php echo get_post_meta ($post->ID, 'author_name', true); ?> </p>
        </a>
    </div>

<?php endwhile; ?>

<?php the_posts_navigation(array(
    'prev_text' => 'Older Posts',
    'next_text' => 'Newer Posts',
    'screen_reader_text' => ' ',
));
?>

It’s showing the same error even I use the previous_posts_link() function.

0
, Md Jwel Miah 2 years 2020-01-01T08:38:23-05:00 0 Answers 91 views 0

Leave an answer

Browse
Browse