When I create in /wp-content/themes/my-theme/bbpress/loop-topics.php then I can overwrite the default BBPress template this way.
But creating /wp-content/themes/my-theme/bbpress/loop-topics-[FORUM_ID_HERE].php doesn’t use this template for that category ID which seems to be against https://developer.wordpress.org/themes/basics/template-hierarchy/ and https://codex.bbpress.org/themes/theme-compatibility/template-hierarchy-in-detail/
Is there a way to create a separate page template per forum ID without using conditional tags in loop-topics.php?
Hi there,
I’m trying to write a script for displaying the recently active topics in general, and active topics since last visit for users. However, I’m running into a problem with bbp_reply_url();
It works fine for most topics, but we also got some rather large topics. For those the url is not generated correct: It misses the /page/1234/ part, e.g:
/forums/topic/kleine-vario-vragen-topic/#post-669703 is wrong.
It should be /forums/topic/kleine-vario-vragen-topic/page/259/#post-669703
The same thing happens when I click the reply ID in the reply header, it also generates an url without the /page/1234/ part.
For those urls missing the /page/1234/ part they redirect me to the first page of the topic, instead of the last page & reply. Can anyone help me solve this?
Best regards,
The solution is quite simple. You have to just know where to add the code.
To get the social login at the bottom of forum home, one need to add it to the bottom of content-archive-forum.php
If u wish to show it under a single forum, then the template is content-single-forum.php
If u wish to show it under all topic then it is bottom of content-single-topic.php
Hi there,
I’m expiriecing a minor template issue within BBpress.
When I try to move or split a post the form is not showing as supposed to, for example:

It doesn’t matter if I make the screen big or small.
<div class="inside-article"> has a width of 864px.
It’s not a big issue as this function is only available for moderators, but still.
Best regards,
Alrik
you will also need to change the fonts as it is currently black, so also add these
.wp-embed {
color: #fff !important;
}
and
.wp-embed-heading a {
color: #fff !important;
}
Easiest way is to change the display using css. Add these to your theme custom css
remove logo by
.wp-embed-footer {
display: none !important;
}
and change the background via
.wp-embed {
background: #000 !important;
}
the no follow is added at output, not on saving.
so we need to see if the topic/reply is written by an admin or editor and then remove the filter that does the no-follow
This coded is untested, but should work
add_filter ('bbp_get_topic_content' , 'follow_topic_if_admin' , 10 , 2) ;
function follow_topic_if_admin ($content, $topic_id) {
$user_id = bbp_get_topic_author_id( $topic_id ) ;
$user_meta=get_userdata($user_id);
$user_roles=$user_meta->roles;
$allowed_roles = array('editor', 'administrator');
if( array_intersect($allowed_roles, $user_roles ) ) {
remove_filter( 'bbp_get_topic_content', 'bbp_rel_nofollow', 50 );
}
return apply_filters( 'follow_topic_if_admin', $content, $topic_id );
}
add_filter ('bbp_get_reply_content' , 'follow_reply_if_admin' , 10 , 2) ;
function follow_reply_if_admin ($content, $reply_id) {
$user_id = bbp_get_reply_author_id( $reply_id ) ;
$user_meta=get_userdata($user_id);
$user_roles=$user_meta->roles;
$allowed_roles = array('editor', 'administrator');
if( array_intersect($allowed_roles, $user_roles ) ) {
remove_filter( 'bbp_get_reply_content', 'bbp_rel_nofollow', 50 );
}
return apply_filters( 'follow_reply_if_admin', $content, $reply_id );
}
Add this to your functions file.
Let me know if it works
Sorry for the late reply Dirk, could you post your “custom” importer code to https://gist.github.com/ and I’ll take a look ๐
Actually…. the solution above wasn’t going to work because if breadcrumbs are enabled and someone clicks on the “Forum Home”, we lose all the effort. However, I finally found the conditional statement that works.
This is only part of my code, but you can get the idea…I originally had this:
// For Jetpack Portfolio heading
elseif (is_post_type_archive()) :
echo '<h1 id="bts-page-title">' . __( 'WordPress Themes', 'bts' ) . '</h1>';
// For bbpress forum heading
elseif (is_bbpress('forum')) :
echo '<h1 id="bts-page-title">' . __( 'Support Forum', 'bts' ) . '</h1>';
However, when I did this, it worked:
// For bbpress forum heading
elseif (is_bbpress('forum') || is_post_type_archive('forum') ) :
echo '<h1 id="bts-page-title">' . __( 'Support Forum', 'bts' ) . '</h1>';
// For Jetpack Portfolio heading
elseif (is_post_type_archive()) :
echo '<h1 id="bts-page-title">' . __( 'WordPress Themes', 'bts' ) . '</h1>';
Now what is interesting, is that if I have the bbpress conditional “after” the Jetpack portfolio one, it would not work and the bbpress heading would be “WordPress Themes”. However, I had this sudden thought that perhaps there is a priority happening here, so I moved the bbpress conditional “before” the Jetpack one, and sure enough it works. The bbpress heading is “Support Forum” and the Jetpack portfolio is “WordPress Themes”.
Something about the sequence caused an issue…what and why I do not know.
Ah….found a fix for the above/last reply. I added the id of the page, so now the custom-bbpress.css only loads for bbpress and that page.
if (is_bbpress() || is_page( 209 ) ) :
Update: I had this in my functions:
if ( is_bbpress()) {
….etc.
But adding:
is_page()
Means that the custom-bbpress.css is going to load on all “pages”. A temporary solution, but not really the right solution.
I am using divi theme, I want to remove the default sidebar in forums page, so I create a new page name “forums”, and add some module and bbpress shortcode in it, but the forums page always look the same with default.
site link
Robin–thanks for the encouragement! muchly needed, I have been fighting with this forum section of my webpage, steady, for several weeks-literally..
I went back at it again today, re- did all my forums, cause I had somehow ( don’t know how it happened) deleted my page that held the forums.( but not the forums themselves) Because it was all scrambled I deleted everything and started over. I got almost everything in place, but now have ran into a new “snag” Don’t know what I am doing wrong…:-(
I made a new forum PAGE to hold all the forums in , and put the short code [bbp-forum-index] โ in the main content section like I did before, only this time when I go to “visit site” the “holding page”won’t put my forums inside the page..
when I click on the menu bar to go to the forums this comes up–
Index of /forum
Parent Directory
cache/
Apache Server at theamericanquarterhorse.com Port 80
I can manually type in after the URL /forums
and the forums will come up manually..
Also, in the main sections that shows all the forums and topics for some reason 2 of them say there is 0 topics in them and that is not the case, I put several topics in the forums, an it shows on the backside there is a topic in there, but not on the topside…
Appreciate any advice
thanks!!
Oh yes about the pigs–here in my area the favorite is Landrace X Yorkshire. The local 4-H kids seem to do well with that cross. there is a few Berkshires around the country too..
Since I was helping a friend convert a phpbb2 board to phpbb3 I thought I’d take the time to also import the forums into bbpress (my preference).
I initially tried the import but could not get it to work and after looking on the forums saw that I was not alone.
To get the import to work I had to remap some fields in the phpbb conversion script and comment out some obsolete ones (took about 30 minutes.
If anyone needs to get your PHPBB3 users and forums converted in BBPress you can replace the phpBB.php file in wp-content\plugins\bbpress\includes\admin\converters to match the following updated code: https://gist.github.com/pixelnated/a7a9c41154cf64696ddd1c2e4f4327ed
simplest way would be to
create a page with a permalink of ‘forums’ (assuming that is what your forums are called in dashboard>settings>forums>forum root slug>forum root)
but with a title of whatever you want the forum page to be called
and just put this shortcode in it
[bbp-forum-index]
That should work
From @matevoun
Then, now :
1/ I think this is because i’ve installed bbPress Enable TinyMCE Visual Tab plugin, but i need this for uploading new media… ๐
2/ Yes, tell me what can i do… ๐
3/ Done ! Thank you ! I’ve installed your plugin. ๐
4/ I think this is a too little for texte + avatar.
How can i do now ?
Hope to read you soon…
1. As a test deactivate that plugin and see if it works without. If so re-enable and contact that plugins author
2. for the forum list
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/loop-single-forum.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/loop-single-forum.php
bbPress will now use this template instead of the original
and you can amend this
so change line 68
<span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
amend 14 to whatever size you want
3. glad you like it
4. without knowing exactly what you want, I cannot suggest css changes – I suspect we will not fix this one
Wait … I forgot I didn’t install the 2.6 Beta of bbPress again. I now did and the conversion started, but it didn’t work out, here’s the log:
Import Finished
17: No threaded replies to import
16: No anonymous reply authors to import
WordPress-Datenbank-Fehler: [Unknown column 'posts.post_text' in 'field list']
SELECT convert(posts.post_id USING "utf8mb4") AS post_id,convert(topics.topic_id USING "utf8mb4") AS topic_id,convert(posts.forum_id USING "utf8mb4") AS forum_id,convert(posts.topic_id USING "utf8mb4") AS topic_id,convert(posts.poster_ip USING "utf8mb4") AS poster_ip,convert(posts.poster_id USING "utf8mb4") AS poster_id,convert(posts.post_username USING "utf8mb4") AS post_username,convert(posts.post_text USING "utf8mb4") AS post_text,convert(posts.post_time USING "utf8mb4") AS post_time FROM forum_posts AS posts LEFT JOIN forum_topics AS topics USING (topic_id) WHERE posts.post_id != topics.topic_first_post_id LIMIT 0, 100
15: No replies to import
14: No favorites to import
13: No topic subscriptions to import
12: No topic tags to import
11: No closed topics to close
10: Keine Super-Stickies zum Anheften vorhanden
9: Keine Stickies zum Anheften
8: No anonymous topic authors to import
WordPress-Datenbank-Fehler: [Unknown column 'topics.topic_posts_approved' in 'field list']
SELECT convert(topics.topic_id USING "utf8mb4") AS topic_id,convert(topics.topic_posts_approved USING "utf8mb4") AS topic_posts_approved,convert(topics.forum_id USING "utf8mb4") AS forum_id,convert(topics.topic_poster USING "utf8mb4") AS topic_poster,convert(topics.topic_first_poster_name USING "utf8mb4") AS topic_first_poster_name,convert(posts.poster_ip USING "utf8mb4") AS poster_ip,convert(posts.post_text USING "utf8mb4") AS post_text,convert(topics.topic_title USING "utf8mb4") AS topic_title,convert(topics.topic_status USING "utf8mb4") AS topic_status,convert(topics.topic_type USING "utf8mb4") AS topic_type,convert(topics.topic_time USING "utf8mb4") AS topic_time,convert(topics.topic_last_post_time USING "utf8mb4") AS topic_last_post_time FROM forum_topics AS topics INNER JOIN forum_posts AS posts USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id LIMIT 0, 100
7: No topics to import
6: No forum subscriptions to import
5: No forum parents to import
WordPress-Datenbank-Fehler: [Unknown column 'forums.parent_id' in 'field list']
SELECT convert(forums.forum_id USING "utf8mb4") AS forum_id,convert(forums.parent_id USING "utf8mb4") AS parent_id,convert(forums.forum_topics_approved USING "utf8mb4") AS forum_topics_approved,convert(forums.forum_posts_approved USING "utf8mb4") AS forum_posts_approved,convert(forums.forum_name USING "utf8mb4") AS forum_name,convert(forums.forum_desc USING "utf8mb4") AS forum_desc,convert(forums.left_id USING "utf8mb4") AS left_id,convert(forums.forum_type USING "utf8mb4") AS forum_type,convert(forums.forum_status USING "utf8mb4") AS forum_status FROM forum_forums AS forums LIMIT 0, 100
4: No forums to import
3: Skipping password clean-up
2: Skipping user clean-up
WordPress-Datenbank-Fehler: [Specified key was too long; max key length is 1000 bytes]
CREATE TABLE oahfp_bbp_converter_translator ( meta_id mediumint(8) unsigned not null auto_increment, value_type varchar(25) null, value_id bigint(20) unsigned not null default '0', meta_key varchar(191) null, meta_value varchar(191) null, PRIMARY KEY (meta_id), KEY value_id (value_id), KEY meta_join (meta_key(191), meta_value(191)) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
1: Recreating sync-table
Continuing Import
Previously stopped at step 1 of 17
I appreciate any help!
Hopefully I got the right forum here.
I want to add a heading when on the “forums” archive home page of the bbpress forum. Right now I have this for jetpack’s portfolio…note this is just a snippet of my code:
if (is_post_type_archive()) :
echo '<h1 id="bts-page-title">' . __( 'WordPress Themes', 'bts' ) . '</h1>';
…but the bbpress forum header area is loading that title as well. I’ve tried so many variations and conditionals, none work. I did manage to get the “forum” titles to show for individual forums with:
elseif (is_bbpress('forum') ) :
echo '<h1 id="bts-page-title">' . __( 'Support Forum', 'bts' ) . '</h1>';
But does anyone have an idea how to get the conditional to show a custom header title for the bbpress home page?
Hello
If want to use that for only 1 forum where exactly di I have to put the ID in this code ?
Thanks a lot
Here’s the exact change in that code that was added for the next bbPress release
https://bbpress.trac.wordpress.org/changeset/6129/
Hello. I just started using a new forum with my bbpress.
bbpress โ 2.5 14-6684
wp 4.9.4
The site is members.institutechiro.com
A user just forwarded me his email and it is full of code. Example.
<p class=”p1″><span class=”s1″>Great first week content.</span></p>
<p class=”p1″><span class=”s1″>I was interested to know that an intellectual generation has 33 integers; making me a 4th gen chiro.</span></p>
please help.
Thanks.
Simon
But i have a question it is correct solution? No performace issue ?
yes it has a performance issue, every line of code has a performance issue.
No idea by what you mean ‘is it the correct solution’ This is a help service for bbpress not a free bespoke website service. I have already gone beyond the usual to help you.
It is up to you to decide the balance of SEO against performance, not me.
this does that
add_filter( 'bbp_get_reply_content', 'rew_remove_code_tags', 10, 2 );
function rew_remove_code_tags ($content, $reply_id) {
if (!is_user_logged_in()) {
$content = preg_replace('~<code(.*?)</code>~Usi', "", $content);
}
return apply_filters( 'rew_remove_code_tags', $content, $reply_id );
}
Ok i find a solution i just change flag /i for flag /s
$content = preg_replace("/<code>.+?<\/code>/S", "", $content);
But i have a question it is correct solution? No performace issue ?