This topic has 5 replies, 3 voices, and was last updated 2 years, 6 months ago ago by Jose alfonso
I have this pagination style but even though there are only 4 pages.. it hides the number “3”, I dont want this to hapen, where may I change this?
Hello,
There is no such option, by default.
Regards
Ok then, could you tell me please in which PHP file or template part is this behavior programmed?
Hello,
Add the below function to your child theme functions.php
function et_woocommerce_pagination() {
$args = array(
'total' => wc_get_loop_prop( 'total_pages' ),
'current' => wc_get_loop_prop( 'current_page' ),
'base' => esc_url_raw( add_query_arg( 'product-page', '%#%', false ) ),
'format' => '?product-page=%#%',
);
// @todo make push ajax loaded styles/scripts in footer and prevent load next times
etheme_enqueue_style( 'pagination', isset($_GET['et_ajax']));
$format = isset( $format ) ? $format : '';
$base = esc_url_raw( add_query_arg( 'product-page', '%#%', false ) );
if ( ! wc_get_loop_prop( 'is_shortcode' ) ) {
$format = '';
$base = esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', wp_specialchars_decode( get_pagenum_link( 999999999 ) ) ) ) );
}
$total = isset( $total ) ? $total : wc_get_loop_prop( 'total_pages' );
$current = isset( $current ) ? $current : wc_get_loop_prop( 'current_page' );
// $et_per_page = ( isset( $_REQUEST['et_per_page'] ) ) ? $_REQUEST['et_per_page'] : etheme_get_option( 'products_per_page', 12 );
$selected_val = ( isset( $_GET['et_per_page'] ) ) ? $_GET['et_per_page'] : false;
return array(
'base' => $base,
'format' => $format,
'add_args' => ( ( ! wc_get_loop_prop( 'is_shortcode' ) && $selected_val ) ? array( 'et_per_page' => $selected_val ) : false ),
'current' => max( 1, $current ),
'total' => $total,
'prev_text' => '<i class="et-icon et-'.(is_rtl() ? 'right' : 'left').'-arrow"><span class="screen-reader-text hidden">'.esc_html__('prev', 'xstore').'</span></i>',
'next_text' => '<i class="et-icon et-'.(is_rtl() ? 'left' : 'right').'-arrow"><span class="screen-reader-text hidden">'.esc_html__('next', 'xstore').'</span></i>',
'type' => 'list',
'end_size' => 1,
'mid_size' => 1,
);
}
and change the
'end_size' => 1,
'mid_size' => 1,
according to your needs.
Regards
Thanks for that! It solves the problem.
Tagged: numbers, pagination, show, templates, woocommerce, wordpress
The issue related to '‘Make pagination show -in between-numbers’' has been successfully resolved, and the topic is now closed for further responses