Skip to:
Content
Pages
Categories
Search
Top
Bottom

Top Ten Topics using [bbp-single-view id=""] and output with page styling


  • khunmax
    Participant

    @khunmax

    Problem:
    I want a New Topics page and a Top Ten Topics page for my forum.

    What I have done already:
    I used Robins shortcode to create the New Topics page set as follows:

    [bbp-display-topic-index show=’25’ template=’short’]

    It displays nicely with no search bar, breadcrumbs, viewing x topics, or pagination.

    I have reviewed Robkks code provided here:

    table with most popular topics

    The code is as follows:

    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' );

    Unfortunately the resulting page output includes breadcrumbs, viewing x topics, and pagination. The pagination also links to spurious pages.

    What I need help with:
    What code do I need to add to Robkks snippet so that the output page is styled the same as the output from Robins shortcode with no breadcrumbs, viewing x topics, or pagination?

    Thanks in advance for your assistance.

    Kind Regards

    Max

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

  • khunmax
    Participant

    @khunmax

    bump…


    Robkk
    Moderator

    @robkk

    Without even trying to mess with Robins plugin.

    You can just make a copy of the content-single-view.php file put it into a child theme, and then edit out whatever you want.

    https://codex.bbpress.org/themes/theme-compatibility/

    You can also use CSS to hide items too. Make sure to use the .bbp-view class for single view pages or if you have a shortcode in a page use this type of class which would work in most themes, but you just need to find the page id, .page-id-ID_NUMBER, replace “ID_NUMBER” with the number or page id of the page. Depending on your set up use any of these classes before any other item selector you are trying to remove.


    khunmax
    Participant

    @khunmax

    Thanks for your assistance and prompt reply.

    It would seem that a good deal of my agony was caused by an error in the documentation page for this website:

    I went to:

    Shortcodes

    Under the subheading “views” I copied the shortcode and then pasted it into the text of my WP page. It appeared as follows:

    [bbp-single-view id=’popular’]

    I then lost hours trying to get the list of popular posts to appear. Instead I just kept getting the oh bother message.

    Turns out that the shortcode has dodgy apostrophes. Once I edited those the shortcode worked:

    [bbp-single-view id='popular']

    This is a very nasty black hole for those that are unaware.


    Robkk
    Moderator

    @robkk

    I then lost hours trying to get the list of popular posts to appear…Turns out that the shortcode has dodgy apostrophes. Once I edited those the shortcode worked:

    Good ole’ curly quotes back at it again.

    Glad you seem to have it all figured out now.


    khunmax
    Participant

    @khunmax

    There should be a warning on the relevant page.


    Robkk
    Moderator

    @robkk

    I just changed them to standard single quotes.


    rajwantsingh27
    Participant

    @rajwantsingh27

    Turns out that the shortcode has dodgy apostrophes. Once I edited those the shortcode worked:

    [bbp-single-view id='popular']

    That was a good find. And yes it works now.

    Thanks

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