Skip to:
Content
Pages
Categories
Search
Top
Bottom

The broken link of 10th pagination


  • Hiro22
    Participant

    @hiro22

    I am using WordPress-bbpress at the my site.
    When many messages were contributed to a topic and it became 10 pages or more, the link to 10th page had broken.

    The following code is the cause.
    It will replace from “&paged=10” to “0”.

    bbpress.2.5.3
    C:\xampp\htdocs\bb\wp-content\plugins\bbpress\includes\topics\template.php
    895 line

    // Remove first page from pagination
    if ( $wp_rewrite->using_permalinks() ) {
    	$pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $pagination_links );
    } else {
    	$pagination_links = str_replace( '&paged=1', '', $pagination_links );
    }

    One solution for correcting this is the following. (Insert “if($pagination[‘total’] == 1)”)

    // Remove first page from pagination
    if ( $wp_rewrite->using_permalinks() ) {
    	$pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $pagination_links );
    } else if($pagination['total'] == 1) {
    	$pagination_links = str_replace( '&paged=1', '', $pagination_links );
    }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar