Ashikur Rahman
Ashikur Rahman

Reputation: 23

Why the_posts_pagination function not working?

the_posts_pagination function is not working: http://pastie.org/pastes/10166362/text

Here is the full code:

<div class="row">
    <div class="col-md-12 text-center">
        <?php
        the_posts_pagination( array(
            'mid_size' => 2,
            'prev_text' => __( 'Newer', 'textdomain' ),
            'next_text' => __( 'Older', 'textdomain' ),
        ));
        ?>
    </div>
</div>

Upvotes: 0

Views: 8715

Answers (1)

David Guerreiro
David Guerreiro

Reputation: 51

the_posts_pagination only works in post listings pages like index.php or archive.php. It will not work in a custom template, for example.

See here : https://codex.wordpress.org/Function_Reference/the_posts_pagination

Upvotes: 2

Related Questions