Created
July 29, 2020 12:56
-
-
Save 1naveengiri/7ff8680a469bc5000848226c3fe99039 to your computer and use it in GitHub Desktop.
Geodirectory reduce the number of buttons in pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'geodir_pagination_args', 'geodir_pagination_args_custom_callback', 10, 1 ); | |
function geodir_pagination_args_custom_callback( $args ){ | |
global $wp_query; | |
$args = array( | |
'base' => esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) ), | |
'format' => '', | |
'add_args' => false, | |
'current' => max( 1, get_query_var( 'paged' ) ), | |
'total' => $wp_query->max_num_pages, | |
'prev_text' => '←', | |
'next_text' => '→', | |
'type' => 'list', | |
'end_size' => 2, | |
'mid_size' => 1, | |
); | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment