Skip to content

Instantly share code, notes, and snippets.

@1naveengiri
Created July 29, 2020 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1naveengiri/7ff8680a469bc5000848226c3fe99039 to your computer and use it in GitHub Desktop.
Save 1naveengiri/7ff8680a469bc5000848226c3fe99039 to your computer and use it in GitHub Desktop.
Geodirectory reduce the number of buttons in pagination
<?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' => '&larr;',
'next_text' => '&rarr;',
'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