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)

  • Hiro22
    Participant

    @hiro22

    wp-content\plugins\bbpress\includes\topics\template.php

    There was the same code also as the following php file.
    wp-content\plugins\bbpress\includes\replies\template.php
    wp-content\plugins\bbpress\includes\search\template.php


    Stephen Edgar
    Keymaster

    @netweb

    Thanks, can you create a ticket on Trac for us and we can take a closer look at the issue and your fix.

    https://bbpress.trac.wordpress.org

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar