Title: pagination problem
Last modified: July 11, 2019

---

# pagination problem

 *  [MikeKJ](https://wordpress.org/support/users/mikekj/)
 * (@mikekj)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/pagination-problem-96/)
 * the code
 *     ```
       echo '';
                  $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
                  $args = array( 'post_type' => 'post','paged' => $paged, 'posts_per_page' => '6' );
                  $loop = new WP_Query( $args );
                  while ( $loop->have_posts() ) : $loop->the_post();
                       echo '';
                       the_post_thumbnail('thumbnail');
                       echo '';
                       the_title();
                       echo '';
                       the_time('l jS F Y');
                       echo '';
                       the_excerpt();
                       echo '</div></div>';
               endwhile;
         echo '</div>';
         echo '';
                $nav = get_the_posts_pagination( array(
                    'prev_text'          => __( '', 'textdomain' ),
                     'next_text'          => __( '', 'textdomain' ),
                       'screen_reader_text' => __( 'A' )
                   ) );
            $nav = str_replace('A', '', $nav);
                                               echo $nav;
        echo '';
       ```
   
 * The problem
    no pagination links appear in the div blogPagination, the 6 blogs
   display fine
 * can anyone spot an error please?
 * The blog I need help with is shop.howardnurseries.co.uk.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Phil](https://wordpress.org/support/users/owendevelopment/)
 * (@owendevelopment)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/pagination-problem-96/#post-11722938)
 * It looks like you might be missing the text in the pagination links, they are
   empty currently – which is why you may not see any links to paginate with. Try
   adding descriptive text on these 2 lines:
 *     ```
       'prev_text'          => __( 'Previous Post', 'textdomain' ),
       'next_text'          => __( 'Next Post', 'textdomain' ),
       ```
   
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/pagination-problem-96/#post-11723972)
 * what file are you editing?
 * the function is only applied to the default query, i.e. `wp_query`, not to custom
   queries…
 * [https://codex.wordpress.org/Function_Reference/get_the_posts_pagination](https://codex.wordpress.org/Function_Reference/get_the_posts_pagination)
 *  Thread Starter [MikeKJ](https://wordpress.org/support/users/mikekj/)
 * (@mikekj)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/pagination-problem-96/#post-11725091)
 * Phil,
    Hmmm I am using, ‘prev_text’ => __( ‘<i class=”fa fa-chevron-left” aria-
   hidden=”true”></i>Previous’, ‘textdomain’ ), ‘next_text’ => __( ‘<i class=”fa
   fa-chevron-right” aria-hidden=”true”></i>Next’, ‘textdomain’ ),
 * maybe code /code stripped it, sorry, but still no output
 * Michael, not editing a file per se I am injecting php into a pagebuilder widget
   with
    Woody ad snippets (PHP snippets | Insert PHP)
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/pagination-problem-96/#post-11726615)
 * So the equivalent of template code then. Michael’s comment about WP_Query still
   applies. Try using `paginate_links()` to build your, uh, well… pagination links.
 *  Thread Starter [MikeKJ](https://wordpress.org/support/users/mikekj/)
 * (@mikekj)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/pagination-problem-96/#post-11726681)
 * Rebuilt using paginate_links(), works a charm
    Brilliant, thank you all.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘pagination problem’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 5 replies
 * 4 participants
 * Last reply from: [MikeKJ](https://wordpress.org/support/users/mikekj/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/pagination-problem-96/#post-11726681)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
