lesterchan / wp-pagenavi

Adds a more advanced paging navigation interface to your WordPress blog.
https://wordpress.org/plugins/wp-pagenavi/
134 stars 49 forks source link

Duplicate pages #65

Open sidzha opened 3 years ago

sidzha commented 3 years ago

Description

I discovered a bug recently. It occurs only when larger_page_numbers_multiple option is active.

It seems if the remainder of $total_pages divide by $larger_page_multiple is equal to 0, plugin will render $total_pages value 2 times. I'am not sure tho, maybe it's something different.

Screenshot

Steps to reproduce

Options from wp-pagenavi.php:

$options = new scbOptions( 'pagenavi_options', __FILE__, array(
    'pages_text'    => __( 'Page %CURRENT_PAGE% of %TOTAL_PAGES%', 'wp-pagenavi' ),
    'current_text'  => '%PAGE_NUMBER%',
    'page_text'     => '%PAGE_NUMBER%',
    'first_text'    => __( '« First', 'wp-pagenavi' ),
    'last_text'     => __( 'Last »', 'wp-pagenavi' ),
    'prev_text'     => __( '«', 'wp-pagenavi' ),
    'next_text'     => __( '»', 'wp-pagenavi' ),
    'dotleft_text'  => __( '...', 'wp-pagenavi' ),
    'dotright_text' => __( '...', 'wp-pagenavi' ),
    'num_pages' => 5,
    'num_larger_page_numbers' => 3,
    'larger_page_numbers_multiple' => 10,
    'always_show' => false,
    'use_pagenavi_css' => true,
    'style' => 1,
) );

Number of pages - exactly 10/20/30 etc.

Thanks for making and maintaining this great plugin! 🙂

sidzha commented 3 years ago

@lesterchan hi! Any news on this?