Skip to:

Search Results for 'bbpress'

Viewing 25 results - 76 through 100 (of 61,966 total)
  • Author
    Search Results
  • #223129

    Hello Regnalf,

    I’m happy to report that your fix worked. I had to apply the new class to all the previous CSS code, but it did the trick!!!

    This is truly got the time to appreciate firsthand php notions such hook and filters, etc and see them at work. It was neat to be able to fine-tune the bbpress-index class vs bbpress and target one vs all parts of the site. I’m grateful.

    Pushing my luck a bit further and modeling your code above and another post I saw elsewhere, I was hoping to get a bit more granular in the way I applied my css to parts of the forum, so I tried this bit of code below to target individual topic pages (or replies?)
    but it didn’t work. If it’s not too much to ask, whenever it’s convenient for you or anyone, could you tell me if this code below somewhat does what you just provided me.

    function my_topic_class($classes) {
    	$classes[] = 'herman-topic-class';
    	return $classes;
    add_filter( 'bbp_get_topic_class','my_topic_class' );

    Nowhere, when viewing the topic page or thread did I see the new class ‘herman-topic-class’ in the Inspect Element utility. With your code, the bbpress and bbpress-index appeared.
    thanks in advance for all the support.



    I don’t know how you excactly you want to style the forum index page, but i found out that the index page doesn’t have the bbpress class included in the body tag like the sub pages. So i had the problem too that i couldn’t style the index page.

    Here is my code i use to add this class, and others, to the body tag for the index page. Then you can style the index page with css.

    add_filter( 'body_class', 'bbpress_add_body_class' );
    function bbpress_add_body_class( $classes )
    	global $wp;
    	$bbpress_index = get_option ('_bbp_root_slug');
    	$bbpress_search = get_option ('_bbp_search_slug');
    	if (strpos($wp->request, $bbpress_index) !== false)
    		$classes[] = "bbpress";		
    	if ($wp->request == $bbpress_index)
    		$classes[] = "bbpress-index";
    	if (strpos($wp->request, $bbpress_index . "/" . $bbpress_search) !== false)
    		$classes[] = "bbpress-search";		
    	return $classes;

    Hi Robin,

    Thanks as always for your assistance.
    Starting with the last question, I have BuddyPress installed but not activated…

    As for the slug, I’ve now ditched the underscore thing and went with /lab for the shortcode page, and in settings, /forums for the root and /forum for the forum. My permalinks are back to %postname%. This current setting guarantees that all my styles are displayed properly when accessing the page with the bbp-forum-index shortcode.

    If I visit the /lab page, it’s all good until I clicked on a specific forum. Then the /lab is lost to acquire /forums (declared the settings) and thus display a 404 error page since there’s no page with that /forums/forum/topic, etc.

    When I switch to having the shortcode page slug and settings slug be the same, no 404 error message, but all customizations vanish.

    I’ve read some other post talking of templates not being properly referenced and honestly, so I created a bbpress folder in my childtheme. Since I’m not sure which templates/file to copy inside the newly-created BBPRESS there, I tried copying all php files included in the default template folder inside the BBPress plugin, and it didn’t go to well, so I removed them.

    Still not sure where else to look. 🙁
    I appreciate other pointers you or other bbpress-ers might have.



    Topic: Feature

    in forum Installation

    Hi, i want to add bbpress. The question is:
    How do i mark a question as “solved”?


    Hi, I just updated my site which was 7 years old and had bbpress1. The Forums and Topics have migrated ok but none of the posts are attributed to a poster. In all cases, including Admin, poster=Anonymous.However the poster IDs are showing in database tables wp_bb_posts and wp_bb_topics. I can’t see how to fix this. Any ideas?


    I just realized that being able to set all the posts in a topic to be moderated would also be an acceptable solution. But the two moderation plugins I have found don’t give this functionality.

    These are the two I checked:

    bbPress – Moderation Tools

    bbPress Moderation

    Does anyone know of a plugin that might help from this angle?


    Is there a way to disable the “Duplicate reply detected” error checking? My forum will mostly be people uploading audio attachments and they may very well just say the same thing each time they post. But in the short term it’s a bother to my testers since they can’t just write “test” each time.

    I know that the error code is in \wp-content\plugins\bbpress\includes\common\functions.php

    I’m guessing there is some way to filter the bbp_check_for_duplicate function, but I don’t know enough php to do that.

    I’ve seen some others post this question in the past but didn’t see answers.

    (BTW, I posted this question a few hours ago but it got marked as spam. Not sure why. I included some code in it but have removed it in this one. Hope it’s ok to repost.)

    Robin W

    there’s no problem with using priorities, especially as you know what it is affecting, just keep in mind that if you add a further bbpress content realted plugin and it doesn’t do what you want it might be related to this


    That will get you to lots of bits of code which are usually around what you are trying to find

    I’ll give it a go, thanks!

    I heard back and GD bbPress Attachments doesn’t have anything I can hook into, so i will just have to increase the priority number.

    Thanks for your help


    I am using WordPress 5.8 and BBPress 2.6.6. It appears by default BBPress creates an topic index page such as I found that Page 2 of this index page is broken; that is I am also of the view that I might experience the same problem with pagination as my forums keep growing. I have searched the bbPress site for solutions to no avail. I stumbled on a few pieces of information that suggested that setting “Forum root should show” to “Topics by Freshness” instead of “Forum Index” kind of works. However, it did not work in my case. I have diactivated many other plugins but still cannot find the cause. Any help?

    Robin W
    Robin W

    bbpress is very large, and finding the right bit of code not easy !!

    have you heard of notepadd++ ?

    Google it and install it.

    Then download bbpress 2.6 to your PC and unzip it.

    Then when you are looking in your browser at bbpress, you’ll usually find a class or ID wrapped around the code you want to change.

    In Notepad++ do ‘search>find in files’ and search the class ot ID name in the bbpress directory you created.

    That will get you to lots of bits of code which are usually around what you are trying to find

    I do this a lot !!


    I’m using BBpress, and I really want my users to be able to reply to each other with the quote of what they’re going to reply, how do I do this? (Example: The person says: “Hello” I want to answer this with the quote “Hello” in my post)


    quite a few bbpress additional plugins authors use ‘bbp’ as a prefix to indicate the the class/code is bbpress related.

    Oh, that’s really good to know. Thank you.

    I was able to find the event (is that the proper name for it??) bbp_get_reply_content and that allowed me to filter the reply content but not the attachment area. Then I changed the priority of the filter to 1000 and I was able to achieve my intended outcome. What I don’t know is if this is good coding practice or not. I thought I read somewhere that super high priorities are not a good idea. In any case, I did post to the plugin company’s forum to see if there is a better/more specific event to filter. I’ll report back what I learn.

    But a general bbPress question if I may. How is one supposed to learn about events such as bbp_get_reply_content? I did a search in the bbPress documentation and there are no results. I was only able to find it by discecting the GD bbPress Attachments code. I did come across a site called Is that the best resource?

    I recently spent several hours trying to fix an issue and when I posted all I got back was ‘already fixed elsewhere’

    🙁 that’s a bummer.

    I really appreciate your work supporting the forum and bbPress. Open Source software is nothing without people who dedicate time to support users. Thank you and all who help here.

    Robin W

    on 2. – no problem 🙂 🙂 🙂 I recently spent several hours trying to fix an issue and when I posted all I got back was ‘already fixed elsewhere’ as the response, so this is a current hot button for me – apologies if I sounded irritable 🙂

    on your filter – quite a few bbpress additional plugins authors use ‘bbp’ as a prefix to indicate the the class/code is bbpress related. bbpress itself does not have a class of bbp-attachments so suspect this is attachments plugin related.

    I would try Milan as a first port of call, he is usually helpful, but do come back if he can’t help.


    Thanks again for such a quick reply!

    1. since this relates to bbpress attachments plugin specifically, it would be better to ask there – Milan should be able to help

    So I just now tested putting the code (in this case a link) I’m trying to filter in the body of a reply in addition to having it be in the attachment (hadn’t thought about trying that before) but before I posted I saw <div class="bbp-attachments"> in the page source and so figured that attachments were something in core bbP, not just the GD bbPress Attachments plugin.

    And the result of that test now is that the link in the body of the reply is also not filtered. So I think I’m back to this being a bbP thing and not a GD bbPress Attachments.

    I notice that you also asked about empty replies in that forum as well as this forum where I gave you a fix – it is very frustrating for plugin authors and helpers when they spend time on an issue only to find that the original poster has already fixed it

    I totally get that! At the time, I had no idea what the response rate was going to be. Sometimes communities/companies reply within the hour (as you did, thanks!!) or if they will take weeks. So not being sure which was causing the problem, I did post in both places. Please forgive me. I was surprised that both places replied so quickly.

    It would be polite to do this

    I did! Within minutes of seeing his response. Wasn’t it visible to you? Should I have linked back to the forum as well? I’m happy to, I just thought the code was enough. I totally know the frustration of support posts that end with “Oh, never mind, I fixed it.” and no solution.

    Anyway, since I now know that my filter also doesn’t catch things in the body of the reply either (and I would like it to) are we back to this being a bbP thing? Are there other troubleshooting things I’m missing? I have disabled all other plugins and tried a default theme.

    Robin W

    ok, 2 things I would say

    1. since this relates to bbpress attachments plugin specifically, it would be better to ask there – Milan should be able to help
    2. On looking at the attachments support forum I notice that you also asked about empty replies in that forum as well as this forum where I gave you a fix – it is very frustrating for plugin authors and helpers when they spend time on an issue only to find that the original poster has already fixed it, and if you post in multiple places and get a fix from one, it is good to update the other places and maybe even post the solution there as well to help others. It would be polite to do this 🙂



    I’m trying to filter links that appear in responses. More specifically, they are links that appear in attachments that have been added through GD bbPress Attachments if that matters. I’m fairly sure the code works because it can filter in the content of a page just fine. Here is the code:

    add_filter( 'the_content', 'myprefix_use_audio_short_tag' );
    function myprefix_use_audio_short_tag( $content ) {
        $reg = "#<a .+ href=\"(.+?\.mp3)\".+?</a>#";
        $content = preg_replace($reg, "[audio mp3='$1' class='asset-audio' title='']", $content);
        return $content;

    I’m guessing that it shouldn’t be the_content, but I am really working beyond my actual understanding of WordPress. I don’t know if I should be putting a theme file name there or if there is some equivalent to the_content that targets responses in bbP.

    Feel free to criticize my regex as well. I’ve actually never used regex in WP/php before.

    BTW, my code has been adapted from here:

    WP 5.8
    bbP 2.6.6


    Layout and functionality – Examples you can use

    In #16 the code says this:

    //filter to add description after forums titles on forum index
    function rw_singleforum_description() {
      echo '<div class="bbp-forum-content">';
      echo bbp_forum_content();
      echo '</div>';
    add_action( 'bbp_template_before_single_forum' , 'rw_singleforum_description');

    But I believe it should be:

    function rw_singleforum_description() {
      echo '<div class="bbp-forum-content">';
      echo bbp_forum_content();
      echo '</div>';
    add_action( 'bbp_template_before_single_forum' , 'rw_singleforum_description');

    The first code causes the html to display on the front end.


    The embeded template is not loaded in any of the bbpress pages because of which on embeding bbpress page, it results in loading complete website inside iframe for embed.

    Getting 404 response on forum archive page


    I’m using an attachment plugin in bbPress. When someone uploads an attachment to a reply but does not put any text in the reply box (which is totally fine for this forum) and then clicks “Submit”, this is what happens:

    – the reply does not post
    – no error message is given
    – the form resets

    I’d like it if either

    – the reply posted with only the attachment
    – or there was an error message
    – or the form didn’t reset (i.e. clicking the button did nothing)

    As it is, it’s very confusing because there is no indication of failure. Someone would have to look for their reply to make sure it submitted. That’s not reliable.

    Thanks for any help!


    Dear admin and all of bbpress forum member. I have 1 question.
    How to pin comment to top in topic?

    Robin W

    ok, I should say that I am NOT a bppress author, I am just a user who tries to help others.

    I am author of bbp private groups plugin, which would not help you directly as you want non logged in to see topics, but does mean that I spent a great deal of time locking down bbpress, and knowing where the code displays stuff.

    so for instance my code will not stop searches, access via a users profile, direct entry of urls and many more.

    so if your site needs to seriously hide replies to non logged in, then you would need to hire a very experienced dev. I am trying to retire, so desperately not trying to take on work !!

    I haven’t looked at your solution, and with a smile, will not have time to do this.

    Robin W

    This should do what you want

     * Replies Loop - Single Reply
     * @package bbPress
     * @subpackage Theme
    // Exit if accessed directly
    defined( 'ABSPATH' ) || exit;
    $reply_id = bbp_get_reply_id() ;
    // first topic reply shouldn't be hiding
    $rep_position = bbp_get_reply_position($reply_id);
    // if user is not logged in and not the first post topic
    if ( !is_user_logged_in() && $rep_position == 2 ) {
    	echo "<br/><strong>Replies only viewable for logged in users</strong>" ;
    bbp_get_template_part( 'form', 'user-login' );
    elseif ( !is_user_logged_in() && $rep_position > 2 ) {
    	//do nothing !!
    //otherwsie use is logged in and/or this is reply 1 !
    else {
    <div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
    	<div class="bbp-meta">
    		<span class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></span>
    		<?php if ( bbp_is_single_user_replies() ) : ?>
    			<span class="bbp-header">
    				<?php esc_html_e( 'in reply to: ', 'bbpress' ); ?>
    				<a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a>
    		<?php endif; ?>
    		<a href="<?php bbp_reply_url(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
    		<?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
    		<?php bbp_reply_admin_links(); ?>
    		<?php do_action( 'bbp_theme_after_reply_admin_links' ); ?>
    	</div><!-- .bbp-meta -->
    </div><!-- #post-<?php bbp_reply_id(); ?> -->
    <div <?php bbp_reply_class(); ?>>
    	<div class="bbp-reply-author">
    		<?php do_action( 'bbp_theme_before_reply_author_details' ); ?>
    		<?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>
    		<?php if ( current_user_can( 'moderate', bbp_get_reply_id() ) ) : ?>
    			<?php do_action( 'bbp_theme_before_reply_author_admin_details' ); ?>
    			<div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
    			<?php do_action( 'bbp_theme_after_reply_author_admin_details' ); ?>
    		<?php endif; ?>
    		<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
    	</div><!-- .bbp-reply-author -->
    	<div class="bbp-reply-content">
    		<?php do_action( 'bbp_theme_before_reply_content' ); ?>
    		<?php bbp_reply_content(); ?>
    		<?php do_action( 'bbp_theme_after_reply_content' ); ?>
    	</div><!-- .bbp-reply-content -->
    </div><!-- .reply -->
    <!-- end of else!!!-->

    BUT be aware this is only hiding replies at this point – there are many ways to see replies in bbpress.


    Thank you for your reply @maxlevel

    I did exactly the same. I’m not sure why it is not working. It may is related to my theme. I’m using Astra theme. I guess you used Hello them, which is for Elementor.

    I hope there is a possible solution since I eager to use bbpress rather than other forum plugins.

Viewing 25 results - 76 through 100 (of 61,966 total)
Skip to toolbar