Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I customise topic pagination


  • Subhransu
    Participant

    @subhransuwp

    In topic listing page I want to customise the pagination link. I am running some custom query to show the topic as per my requirement, I want to show the topic pagination as per my requirement.

    Please help if any trick.

Viewing 4 replies - 1 through 4 (of 4 total)

  • Subhransu
    Participant

    @subhransuwp

    I got my answer, so no need to reply this topic


    Robin W
    Moderator

    @robin-w

    would be great if you posted your solution here to help others that might have the same issue


    Subhransu
    Participant

    @subhransuwp

    Thank u for posting, sure i am updating my solution,

    I have used one hook to customize the topic pagination link. I was the issue with the total number of topic count as per my requirement.

    function ntwb_bbpress_custom_pagination( $args ) {

    $topic_per_page = bbp_get_topics_per_page();
    $ttt = bbp_get_forum_id();
    $total_topic = custom_forum_topic_count($ttt); //get your topic count as your requirement[This is my own function]
    $total = ( $topic_per_page === $total_topic ) ? 1 : ceil( (int) $total_topic / (int) $topic_per_page );

    $args[‘total’] = $total;
    return $args;
    }
    add_filter( ‘bbp_topic_pagination’, ‘ntwb_bbpress_custom_pagination’ );


    Robin W
    Moderator

    @robin-w

    Thanks !!

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