Skip to:
Content
Pages
Categories
Search
Top
Bottom

table with most popular topics


  • dc4x_admin
    Participant

    @dc4x_admin

    hii,

    I used this shortcode to see the table with most popular topics on my homepage:
    [bbp-single-view id="popular"]

    the problem is that when user add topics the table get’s longer.
    how can I limit the table rows?

    thank

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

  • Robkk
    Moderator

    @robkk

    add this to your child theme functions.php or a functionality plugin.

    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 then add this to your page.

    [bbp-single-view id="top-five"]


    dc4x_admin
    Participant

    @dc4x_admin

    Thanks alot.
    it’s exactly what i needed.


    dc4x_admin
    Participant

    @dc4x_admin

    but why does is show me also pagination?

    when I click to the next page it goes to some post at the site..


    Robkk
    Moderator

    @robkk

    @dc4x_admin

    I will test it out a bit more


    dc4x_admin
    Participant

    @dc4x_admin

    @robkk

    Did you find anything?
    I still dont understand it…


    Robkk
    Moderator

    @robkk

    @dc4x_admin

    I found something awhile ago , sorry I forgot about this topic.

    i cannont seem to find the code i used though.

    But you can just use this plugin instead , it should do the same thing.

    https://wordpress.org/plugins/bbpress-popular-topics/

    The shortcode is something like this for that plugin.

    [bbpresspopulartopics qty = 5]


    khunmax
    Participant

    @khunmax

    Robkk

    The above listed plugin plugin no longer works.

    Your code to register a top five works however the resulting page output from this snippet includes breadcrumbs, viewing x topics, and pagination. The pagination also links to spurious pages.

    What is required to style the output page so that it does not include breadcrumbs, viewing x topics, or pagination?

    Kind Regards

    Max

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