Skip to main content
updated code format
Source Link
RiddleMeThis
  • 3.8k
  • 8
  • 21
  • 30

Works for me`global $wp_query;me

if ( function_exists( 'pagination' ) ) { pagination( $wp_query->max_num_pages ); }else { // Previous/next page navigation. the_posts_pagination( array( 'prev_text' => __( 'Previous' ), 'next_text' => __( 'Next' ), 'screen_reader_text' => __( ' ' ) //'before_page_number' => '' . __( 'Page' ) . ' ', ) ); };`

global $wp_query;

if ( function_exists( 'pagination' ) ) {
    pagination( $wp_query->max_num_pages ); 
}else {
    // Previous/next page navigation.
    the_posts_pagination( array(
        'prev_text'          => __( 'Previous' ),
        'next_text'          => __( 'Next' ),
        'screen_reader_text' => __( ' ' )
        //'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page' ) . ' </span>',
    ));
};

Works for me`global $wp_query;

if ( function_exists( 'pagination' ) ) { pagination( $wp_query->max_num_pages ); }else { // Previous/next page navigation. the_posts_pagination( array( 'prev_text' => __( 'Previous' ), 'next_text' => __( 'Next' ), 'screen_reader_text' => __( ' ' ) //'before_page_number' => '' . __( 'Page' ) . ' ', ) ); };`

Works for me

global $wp_query;

if ( function_exists( 'pagination' ) ) {
    pagination( $wp_query->max_num_pages ); 
}else {
    // Previous/next page navigation.
    the_posts_pagination( array(
        'prev_text'          => __( 'Previous' ),
        'next_text'          => __( 'Next' ),
        'screen_reader_text' => __( ' ' )
        //'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page' ) . ' </span>',
    ));
};
Source Link

Works for me`global $wp_query;

if ( function_exists( 'pagination' ) ) { pagination( $wp_query->max_num_pages ); }else { // Previous/next page navigation. the_posts_pagination( array( 'prev_text' => __( 'Previous' ), 'next_text' => __( 'Next' ), 'screen_reader_text' => __( ' ' ) //'before_page_number' => '' . __( 'Page' ) . ' ', ) ); };`