Skip to:
Content
Pages
Categories
Search
Top
Bottom

No Replies Widget – [bbp-single-view id=’no-replies’]?


  • Julia_B
    Participant

    @julia_b

    I want to switch the Top Five Topics widget on my site to a Topics With No Replies widget.

    I think I’ve found the code referring to the Top Five Topics widget in functions.php – this looks like it:

    function rk_top_five_view() {
    bbp_register_view( ‘top-five’, __( ‘5 Most Popular Topics’ ), array(
    ‘meta_key’ => ‘_bbp_reply_count’,
    ‘posts_per_page’ => ‘5’ ,
    ‘ max_num_pages’ => ‘1’,
    ‘orderby’ => ‘meta_value_num’ ),
    false );
    }

    add_action( ‘bbp_register_views’, ‘rk_top_five_view’ );

    And I think this is the relevant code on the page where the widget is displayed:
    [bbp-single-view id="top-five"]

    According to https://codex.bbpress.org/features/shortcodes/ the code for No Replies is:
    [bbp-single-view id=’no-replies’]

    So I’m guessing that on the page I just need to replace top-five code with no-replies…?

    But what about the code in functions.php?

    I found this on github:

    bbp_register_view(
    ‘no-replies’,
    __( ‘Topics with no replies’, ‘bbpress’ ),
    apply_filters( ‘bbp_register_view_no_replies’, array(
    ‘meta_key’ => ‘_bbp_reply_count’,
    ‘meta_value’ => 1,
    ‘meta_compare’ => ‘<‘,
    ‘orderby’ => ”
    )
    ) );
    }

    Is this what I need? Or should it start with function like the current code I posted at the top?

    Please excuse me if I’m missing something obvious here – I’m just the website owner, not a developer.

    Thanks in advance 🙂

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

  • Stephen Edgar
    Keymaster

    @netweb

    bbPress includes the “no replies” view, so you would only need to replace the “top five” shortcode you are currently using with bbPress’ [bbp-single-view id=no-replies] 🙂


    Julia_B
    Participant

    @julia_b

    Thanks @netweb

    I just tried that and it did work, but the widget showed 15 posts and I need it to only show 5.


    Julia_B
    Participant

    @julia_b

    Can anyone help? 🙂


    Julia_B
    Participant

    @julia_b

    @robkk Looks like you’ve been able to help some other people out with similar issues – any advice for me please?
    Thanks 🙂


    Julia_B
    Participant

    @julia_b

    I’m still looking for a solution for this. Can anyone help please?

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