How can I show partial content via my BuddyPress/bbPress Forum?

Hi all,

I am just wondering if it is possible to only show a certain amount of content when it comes to BuddyPress/bbPress forums just as you would a post or a page? I tried using conditionals, but they did not work.

The only problem using custom capabilities is no one (logged in or logged out) can see the topic in order to get directed to the Membership page. I am not even sure if Google bots can read the topic?

Thanks and regards,

Josh

If anyone can please let me know if this is even possible or not I would greatly appreciate it! I have been doing some research and have not found a clear answer. I think if there was a note about bbPress and BuddyPress regarding the s2Member conditionals along with select other explanations in the manual, that would be great!

Hi Josh.

If you can use WP shortcodes in the BuddyPress or bbPress, the s2If conditional should work. Or you can have a PHP execution plugin and use PHP conditionals instead.

If you protect the page, the whole page is restricted, not just a portion. Custom capabilities can’t be applied to bbPress or BuddyPress unless you use a custom hack. The interface lets you protect with the level URI restriction though.

But like I said, the conditional would be the way to go if you just want a portion of the page protected.

:slight_smile:

1 Like

Hi Clavaque,

Thank you for that information! You are much appreciated. Unfortunately, I cannot use WordPress shortcodes via bbPress or BuddyPress.

I just downloaded a PHP plugin in order to implement some PHP Conditionals as you suggested. I do have a couple questions, however. Firstly, can those examples via the Scripting manual can be executed and then the [s2If …] would execute via bbPress and BuddyPress? And if they would not be executed, would I need to add new PHP along with the shortcode via the forum topic(s)?

In the meantime, I will be running some of my own tests and will update this topic with any resolutions if I do not hear back from you or anyone else. Thank you again.

Thanks and regards,

Josh

I’m not sure I understood your questions. But you can find some PHP conditional examples here: WP Admin > s2Member > API / Scripting > Advanced Conditionals

if you use that, you’d not use s2If. s2If is a shortcode, and you say you can’t use shortcodes.

:slight_smile:

My question is where would I place the PHP Conditionals for bbPress? This is what I am really struggling with. I am watching JasonWSInc via YouTube go over the Advanced Conditionals and he is placing the PHP inside the HTML via Edit Page. I tried that with the topic but it did not work. I am at a standstill now. Still doing research though.

Thank you for all of your help, it is much appreciated.

You’d need a plugin that lets you execute PHP in bbPress. Maybe one of these? https://bbpress.org/plugins/?ps=php

:slight_smile:

1 Like

Oh, and relevant to using bbPress, check out the panel here: WP Admin > s2Member > Other Integrations > bbPress

I tried several and none worked. For some reason the Membership Options Page I created and set through s2Member shows a 404. I cannot access nor can I preview it and it is supposedly always publicly available. I wonder if this could be the culprit? Have you ever heard of this?

Here is an update.

The 404 may have been caused by my theme, but it is fixed. The PHP plugins will not work because the theme’s frontend editor for the forums does not process code. They are working on changing it, so it should no longer be an issue hopefully!

Thank you for all of your help, it is much appreciated!

1 Like