• paul2411

    (@paul2411)


    Hello,

    I setup a custom sidebar for my forums (bbpress) page but the default sidebar shows up instead. Am I missing something ? Thank you

    The page I need help with: [log in to see the link]

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

    (@skalanter)

    Hello @paul2411,

    The quality of the images you sent is low, and I can’t understand where you are setting the custom sidebar.
    Are you setting the custom sidebar on a simple page, or is it in the archive page of BBPress?

    Please tell us how we can replicate your steps to arrive at the issue on a fresh WordPress installation.

    By the way, I fully tested in the following way and didn’t see any issues,
    First created a custom sidebar
    then added “meta box” to the “forum” CPT by this article: https://docs.oceanwp.org/article/368-add-the-oceanwp-settings-metabox-in-your-custom-post-type
    After that set that custom sidebar to one of /forum/ and didn’t see any issue.
    And for the archive page(/forums/), I use the following function:

    
    function custom_sidebar_only_for_archive() {
        if ( is_page_template( 'forums' ) ) {
            return 'ocs-forum'; // Display a specific sidebar on a certain template
        } else {
            return 'ocs-forum'; // Use the default sidebar for other cases
        }
    }
    add_filter( 'ocean_get_sidebar', 'custom_sidebar_only_for_archive' );
    

    Please check the screenshots attached at this link:
    https://postimg.cc/gallery/rktzqd6

    I hope it helps,
    Best Regards

    • This reply was modified 11 months ago by Shahin.
    Thread Starter paul2411

    (@paul2411)

    Hello,

    Thank you for your detailed reply. I managed to add the custom sidebar to my CPTs ‘Forum’ and ‘Topic’ and for the Forums archive page.

    I don’t understand why it has to be done this way though (adding code).

    Thank you

    • This reply was modified 11 months ago by paul2411.

    Hello @paul2411,

    You’re welcome; I’m glad it is solved.

    Sometimes, code will unlock a vast range of customization options beyond out-of-the-box. In your case, since there isn’t any option to manage the sidebar for the /forums/ page as an archive page, you can use the above code to add your custom sidebar, which is the correct way.

    Hope you have a wonderful year ahead.
    Best Regards

    Thread Starter paul2411

    (@paul2411)

    Hello,

    I noticed that the Forums sidebar don’t show up on the forums page:

    https://adelineferlin.com/forums/

    But show up on :

    https://adelineferlin.com/forums/forum/particuliers/forum-1/

    https://adelineferlin.com/forums/forum/particuliers/

    I checked the page itself in OceanWP settings , the sidebar is on “Forums”.

    https://ibb.co/jz10637

    Have you any idea why ?

    Thank you

    Code :

    https://ibb.co/jz10637

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘BBPress + Sidebar’ is closed to new replies.