Skip to:
Content
Pages
Categories
Search
Top
Bottom

Sidebar before the main loop


  • JohnnyPea
    Member

    @johnnypea

    When I load the sidebar with the_content(), the_excerpt() or similar content function in custom loop before the main loop on page the forums (their contents) are displayed through that function in the sidebar.

    So I can’t use these content function before the main loop on page template? It seems to me bbPress is hooking the first function of this kind (the_content(), the_excerpt()…) on a page.

    I suppose bbPress plugin should avoid this to prevent malfunction in some themes.

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

  • eklay
    Participant

    @eklay

    @johnnypea – Did you ever get this figured out? Using the_excerpt() anywhere on a BBPress page returns Forum content, even when called within a non-forum custom loop, and then completely clears the $post object… This is very frustrating.


    eklay
    Participant

    @eklay

    I’ve found the offending filter: ‘bbp_replace_the_content’

    The function bbp_replace_the_content() hijacks the content of any post, regardless of which loop it is in, based simply on whether the page is also the forum archive or topic archive page.

    I was able to get the excerpt for my custom loop, while still preserving the Forum archive on the same page, by using remove_filter( ‘the_content’, ‘bbp_replace_the_content’ ) before the_excerpt() and add_filter( ‘the_content’, ‘bbp_replace_the_content’ ) after.

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

You must be logged in to reply to this topic.