Hello,
I want to add a back link to get back to the page where the bbp-single-forum shortcode was implemented. I currently still have the defaults settings and the forum root is “forum”. So I will only see the single forum but not the page I implemented the shortcode in.
I have more than 1 page with a forum, so I would need to define the wordpress root page for each forum, if it is not possible to detect this dynamically I guess.
Thanks for any help!
– Dennis
How about this code?
type="checkbox" ⇒ type="checkbox"checked
You can customize the form-reply.php and form-topic.php .
<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox"checked value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> />
You can change the code simply and put both files in your child theme’s bbpress folder.
Your code works quite well. How simple they are!
I tried to customize it , but I couldn’t. I couldn’t get strpos code.
Thank you for your kindness.
without getting complicated, this will work quite well
add_filter ('bbp_get_topic_subscribe_link' , 'julia_unubsribe') ;
function julia_unubsribe($retval) {
if (strpos($retval, 'Subscribe') !== FALSE) {
$retval = '' ;
}
return $retval ;
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
it will let someone unsubscribe from a topic, but does let them re-subscribe if they stay within that topic (so if they click by mistake, they can unclick immediately) once they leave that topic, then they can’t subscribe, and they can’t subscribe to a topic that they are not subscribed to in the first place.
‘reply page’ means content-single-topic.php .
<?php bbp_topic_subscription_link(); ?>
includes> topics > template.php
function bbp_topic_subscription_link( $args = array() ) {
echo bbp_get_topic_subscription_link( $args );
}
/**
* Get the topic subscription link
*
* A custom wrapper for bbp_get_user_subscribe_link()
*
* @since 2.5.0 bbPress (r5156)
* @since 2.6.0 bbPress (r6308) Add 'redirect_to' support
*/
function bbp_get_topic_subscription_link( $args = array() ) {
// Defaults
$retval = false;
$user_id = bbp_get_current_user_id();
$redirect_to = bbp_is_subscriptions()
? bbp_get_subscriptions_permalink( $user_id )
: '';
// Parse the arguments
$r = bbp_parse_args( $args, array(
'user_id' => $user_id,
'object_id' => bbp_get_topic_id(),
'object_type' => 'post',
'before' => ' | ',
'after' => '',
'subscribe' => esc_html__( 'Subscribe', 'bbpress' ),
'unsubscribe' => esc_html__( 'Unsubscribe', 'bbpress' ),
'redirect_to' => $redirect_to
), 'get_topic_subscribe_link' );
// Get the link
$retval = bbp_get_user_subscribe_link( $r );
// Filter & return
return apply_filters( 'bbp_get_topic_subscribe_link', $retval, $r, $args );
}
bbpress has an ID not a class (you don’t need to know what this means!) , so try
body#bbpress .memberoni_breadcrumbs {
display: none;
}
Quick question regarding styling the pages made by bbpress. Inside the forum I’m using the bbpress breadcrumbs and they work wonderfully. My theme uses breadcrumbs, and I use them for the rest of my site, (non-forum pages)… but they don’t work properly within the forum. I have the option of disabling my theme’s breadcrumbs on a page by page basis, but it only disables them on the page I inserted the breadcrumbs in. I’m assuming this is because the rest of the forum pages are generated by bbpress.
So basically, I want to disable my themes breadcrumbs on all forum pages and let bbpress handle breadcrumbs there. My theme’s developer shared this with me…
“I think the easiest way to do this would be to hide the breadcrumbs on the required pages. I believe all bbpress pages have a body with the class “bbpress” so this should be doable with some simple CSS (you can add this to your child theme’s style.css file):
body.bbpress .memberoni_breadcrumbs {
display: none;
}”
But this doesn’t work for me. I’ve tried to inspect the page using chrome to see what I’m doing wrong, but can’t seem to figure it out.
Any help would be appreciated!
for registration, set up a pages called whatever you wish and use the relevant shortcodes
[bbp-login] – Display the login screen.
[bbp-register] – Display the register screen.
[bbp-lost-pass] – Display the lost password screen.
Thanks – however isn’t there some code which reads the status value and appends it – so something like
$class = “status-” . $status = get_status (id) ??
if you’ve cloned the forum widget, you can set a class – the test is
if ( bbp_is_forum_closed(forum_id)) ...
and
if ( bbp_is_topic_closed (topic_id)) ...
interesting..it looks ok on my test site, but I can see it doesn’t on yours.
I should state that I am just a bbpress user who helps out here, not the plugin author.
2 choices
1. amend the actual widget file – yes that is said by many to be bad practice, but bbpress does not do frequent releases, and if it is your site and you know what you changed, is probably the quickest and easiest answer
2. clone the widget to your theme’s child functions file. so take the whole function that starts
class BBP_Forums_Widget extends WP_Widget {
Now you’ll need to rename it, so change BBP_Forums_Widget wherever quoted to something unique, and change names/title in these lines
public function __construct() {
$widget_ops = apply_filters( 'bbp_forums_widget_options', array(
'classname' => 'widget_display_forums',
'description' => esc_html__( 'A list of forums with an option to set the parent.', 'bbpress' ),
'customize_selective_refresh' => true
) );
parent::__construct( false, esc_html__( '(bbPress) Forums List', 'bbpress' ), $widget_ops );
}
/**
* Register the widget
*
* @since 2.0.0 bbPress (r3389)
*/
public static function register_widget() {
register_widget( 'BBP_Forums_Widget' );
}
you can then amend the offending line.
In the main forum/topic view the css is updated with status-closed.
However the Forum and Topic widgets do not update the status.
I would like to change this.
Where does the existing code set status-closed for both Forums and Topics.
Hopefully you can see what I’m wanting to show here
The html <a> link for the list of forums is wrong – it include white space in the front.
If you don’t think it’s a bug, then where do I place a modified widgets.php in my theme to fix the issue?
this is from BBP_Forums_Widget
<a class="bbp-forum-title" href="<?php bbp_forum_permalink( $widget_query->post->ID ); ?>">
<?php bbp_forum_title( $widget_query->post->ID ); ?>
</a>
and this is from BBP_Topics_Widget which displays correctly with no leading white space.
<a class="bbp-forum-title" href="<?php bbp_topic_permalink( $topic_id ); ?>"><?php bbp_topic_title( $topic_id ); ?></a>
The bbPress codex explains that when bbPress is installed it creates three new menu items in the WordPress backend. These are Forums, Topics and Replies.
I do not have the Forums topic. Is there some way that I can add it in?
Hi guys,
i have found the file “class-bp-core-login-widget.php” and I need to add an additional link to the users direct messages “https://url/username/messages” right under the users name within the widget (after a user is logged it).
I am able to do in the code but this is not a correct way (break on update), so please help me, is there a way to add this simple link to the widget?
Thanks,
Christian
Thank you Robin 😊
About the notes. Would you recommend a excel file logging everything I do with any code; for example which files (path) and which line/lines etc?
I have done some changes when reading some easy codes that I understood how to add etc. But dont remember them by now 😅
Were you ever able to resolve this problem with UnCode? I’m having the same issue where the breadbrumbs are being displayed, and there’s a huge dummy div taking up a lot of space above user profile pages (perhaps others I haven’t looked at yet). I asked UnCode Support and they directed me to check with Buddy Press. When I use the CSS provided above it hides other elements on the site like images on the WooCommerce store front.
I’ve tried both “Methods” of deploying the forums with the same result.
https://staging.sansevieria-international.org/forums/users/admin
first thing I would do is break this into separate functions
add_filter( 'generate_smooth_scroll_elements', 'th_scroll' ) ;
function th_scroll ( $elements ) {
$elements[] = 'a[href*="#"]:not(.wp-show-posts-read-more)';
return $elements;
}
I’ve implemented a smooth-scrolling snippet from GeneratePress as documented here: https://docs.generatepress.com/article/generate_smooth_scroll_elements/
The exact snippet code I use is this:
add_filter( 'generate_smooth_scroll_elements', function( $elements ) {
$elements[] = 'a[href*="#"]:not(.wp-show-posts-read-more)';
return $elements;
} );
This works for everything on my main site (blog) but does not seem to work for my bbpress forum. I’ve reached out to GeneratePress and got this response:
Hmm I’m not sure why that’s not working unfortunately.
You will need to check with bbPress’ support to see if there is anything from their plugin that’s blocking the code from being executed.
Do you have any ideas on how to solve this? Many thanks in advance!
An example URL: https://300hours.com/forum/cfa/level-2/
New Information:
The forum page is viewable using the shortcode [bbp-forum-index].
When I click on main forum page I can see forums listed as before. When I click on a forum title link as bfore I get this message:
Oops! That page can’t be found.
It looks like nothing was found at this location. Maybe try a search?
Search for:
Search …
Hi, still setting things up here…
I was just wondering if there was a shortcode or something to add a contact for to my forum?
My site just has a contact page already created, with the text: [contact-form-7 id=”4″ title=”Contact Form”]. But I don’t see that plugin installed.
I would prefer to add a contact form / widget natively if possible. If not, is contact form 7 plugin the way to go?
Thanks guys!
@egyptimhotep
Forum title remains numeric

Below is the code in single.php
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="article">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_content(); ?>
<h2>Forum: <?php echo basename(get_permalink()); ?></h2>
<?php
$post = get_post(get_the_ID());
$mypost = get_page_by_title(get_the_ID(),OBJECT,'forum');
echo do_shortcode( '[bbp-single-forum id='.$mypost->ID.']' ); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
It would be great if you could help me find, where i made a mistake 🙂
ok, several ways to go about it, these are in no particular order
a ) as it is a paid theme with presumably support – ask the theme provider – most will say it is out of scope, but occasionally you get lucky.
b) see this link – item 8
Step by step guide to setting up a bbPress forum – Part 1
c) this plugin is old but still works, and lets you try different theme templates to see if they work better
bbPress WP Tweaks
Hi Robin,
Would you be able to assist with this. I have got the code that i would like to change the min height so that the option in the drop down box fits nicely.
on the Topic Type and Topic Status drop down box, the font of the drop down selection is way too big and it looks cut off.I want to make sure the selection eg. “Normal”, “Sticky” etc fits nicely in the drop down box
#bbpress-forums fieldset.bbp-form input[type=text], #bbpress-forums fieldset.bbp-form select
{
min-height: 35px;}
I tried with ! important and it doesnt fix the formatting. Not sure why. I inserted this in the css section in bbstyle pack.
Thanks