Hi, I am working on a Forums site which uses bbpress, but the topics created doesnt show up in the forums, unless you run the repair tool from Admin Panel. Is there any way of doing it automatically, through code?
My idea is to run repair tool in CronJob, so I dont have to manually run the Repair tool every single time!
I finally fixed my forum with another workaround.
I change template.php in topics folder, from
// Pretty permalinks, previously used
bbp_use_pretty_urls()`
// https://bbpress.trac.wordpress.org/ticket/3054
if ( false === strpos( $topic_link, ‘?’ ) ) {
$url = trailingslashit( $topic_link ) . bbp_get_edit_slug();
$url = user_trailingslashit( $url );
// Unpretty permalinks
} else {
$url = add_query_arg( array(
bbp_get_topic_post_type() => $topic->post_name,
bbp_get_edit_rewrite_id() => ‘1’
), $topic_link );
}`
I disable permalinks for edit of the topic when It’s Italian
// Pretty permalinks, previously used
bbp_use_pretty_urls()`
// https://bbpress.trac.wordpress.org/ticket/3054
if ( false === strpos( $topic_link, ‘?’ ) && strpos($topic_link, ‘/it/’) == false ) {
$url = trailingslashit( $topic_link ) . bbp_get_edit_slug();
$url = user_trailingslashit( $url );
// Unpretty permalinks
} else {
$url = add_query_arg( array(
bbp_get_topic_post_type() => $topic->post_name,
bbp_get_edit_rewrite_id() => ‘1’
), $topic_link );
}`
I hope this helps.
You can check the behavior on http://www.mischianti.org
Bye Renzo
Hi again,
I did some progress.
With this code
function filter_pll_check_canonical_url( $redirect_url, $language ) {
if(strpos($redirect_url, '/edit/') !== false && strpos($redirect_url, '/forums/') !== false && strpos($redirect_url, '/reply/') !== false) {
$redirect_url = str_replace('/it/', '/', $redirect_url);
$redirect_url = str_replace('/en/', '/', $redirect_url);
}
return $redirect_url;
}
add_filter( 'pll_check_canonical_url', 'filter_pll_check_canonical_url', 10, 2 );
reply works correctly, but if I remove the “reply” filter I had an issue with topics, the forum ID of the Italian language is not present on the selection in editor.
The solution can be not to use “pretty” edit links like
http://localhost:82/it/forums/topic/moved-reply-to-prova-manipolazione-url/edit/
but the link in a query string, like when the topic isn’t approved.
http://localhost:82/it/?post_type=topic&p=18604&topic=moved-reply-to-prova-manipolazione-url&edit=1&view=all
there is a way to enable this kind of link as default for edit and the other topic action?
Thanks Renzo
@viridw,
I may misunderstand what you’re asking. But assuming you’re enabling the WP visual editor by doing something like this:
function bbp_enable_visual_editor( $args = array() ) {
$args['tinymce'] = true;
return $args;
}
add_filter('bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor');
I used to do that, but new WP releases seemed to break it in various ways. And there were other problems primarily with mobile devices. I decided it wasn’t worth the trouble and got rid of it.
Just sharing my experience. Your milage may vary 🙂
Add added the JS code and it helped.
I tried bbp style pack, but it’s too comprehensive and complex for my needs.
Thank you.
ok, so if my solution above does not work, your issue is site specific, so without visiting your site and an example I cannot give you code – in essence I can look at what the browser is receiving and see the correct code needed. You can contact me via my website
Contact me
and give me some access details, and I will try and help further.
However alternately if you know how to use FTP, you could try this
find
wp-content/plugins/bbpress/templates/default/bbpress/user-profile.php
transfer this to your pc and edit
you will see that line 16 says
<h2 class="entry-title">@<?php bbp_displayed_user_field( 'user_nicename' ); ?></h2>
delete this line and save
then 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
Then transfer the file you saved above 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-reply.php
bbPress will now use this template instead of the original
this is a known bug.
either
if( !function_exists( 'bbpress_browser_supports_js' ) ){
function bbpress_browser_supports_js() {
echo '<script>document.body.classList.remove("no-js");</script>';
}
add_action( 'wp_footer', 'bbpress_browser_supports_js' );
}
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
or
install
bbp style pack
which has the fix built in
Hi. Nice one! this is also my exact concern, I’m very thankful to see this in the forum. It is also a big help for me, I successfully fixed and corrected my codes. Thanks again.
it may be a load order issue, try
#bbpress-forums #bbp-user-wrapper h2.entry-title {
display: none !important;
}
I would like to add a title banner to all my forum pages so that it is consistent with the rest of the website.
This page is an example of what I would like it to look like – wbc1.otiscreative.co.uk/forum-home/ – this is created with Divi though with shortcodes which doesn’t work so this is just for visual representation.
So, I think I am after a way to inject this title banner into the forum pages, perhaps using the functions.php file, I am not entirely sure but would really appreciate some guidance on how to crack this.
This is my current forum layout – wbc1.otiscreative.co.uk/forums/
Thanks so much,
Ollie
PS. I am using latest version of WP and bbPress.
Hi there,
I hope someone can help. I have an issue with these two bbPress pages.
See here example: wbc1.otiscreative.co.uk/forums/users/ollie-tubb/
It picks up the divi default formatting rather than the structure of the other pages, see example here: wbc1.otiscreative.co.uk/advice/finance/
It needs to sit in the same style template but I don’t know how to do this. I am using Divi theme but i am using the bbPress default set-up (not shortcodes).
Help would be very much appreciated.
Many thanks,
Ollie
PS. I am using latest version of WP and bbPress.
The changelog page https://codex.bbpress.org/releases/ is not mentioning version 2.6.8 nor 2.6.9. and links to blog are not working.
Would be handy if that would be accurate.
The blog is ok though.
Thanks.
not in native bbpress, hence why I was asking how they were doing this – might be a buddypreess thing, or code added.
Hi,
I am having problems setting up the forum for my community.
I have used the short code [bbp-forum-index] on the “forum” page but nothing appears on the screen, it is blank.
The subscription I take for my website is on wordpress.com and I’ve seen a few tutorials on how to setup the bbPress but had no success. It seems others on the internet have more options on wordpress than my subscription on wordpress.com, hope this helps to figure out.
I hope to get this done.
Cheers and waiting for a reply,
André Machado
Hello,
The website is up to date (WP 5.9 and 2.6.9 for bbpress)
I experience a randomly error on a website I manage. When you click on the answers in the backoffice you experience several times the same error, a white page with an error 500 and a fatal error :
WP_Fatal_Error_Handler->handle
WP_Fatal_Error_Handler->display_error_template
WP_Fatal_Error_Handler->display_default_error_template
wp_die
and
WP_Fatal_Error_Handler->handle()
[PHP Kernel]
WP_Fatal_Error_Handler->display_error_template(Array, WP_Error)
./wp-includes/class-wp-fatal-error-handler.php:57
WP_Fatal_Error_Handler->display_default_error_template(Array, WP_Error)
./wp-includes/class-wp-fatal-error-handler.php:152
wp_die(WP_Error, <code></code>, Array)
./wp-includes/class-wp-fatal-error-handler.php:233
Could you help please ?
Thank you.
Valérie
Put this in the custom css part of your theme
#bbpress-forums #bbp-user-wrapper h2.entry-title {
display: none;
}
I’ve just taken a look.
bbpress uses the wordpress ‘untrash’ function to restore topics and replies.
That wordpress function includes a note saying
* By default posts that are restored will be assigned a status of 'draft'.
* Prior to WordPress 5.6.0, restored posts were always assigned their original status.
so this was a change in WordPress 5.6
However WordPress helpfully includes a hook we can link to to restore the previous status automatically
add_filter ('wp_untrash_post_status', 'wp_untrash_post_set_previous_status' , 10 , 3) ;
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
@spanky11, as Robin clarified in his reply to my request, I had quite a few links buried in the code I pasted (which was an oversight on my part)…and that explained why the post was held for moderation.
If you’ve confirmed the link count (under 3), perhaps making a direct appeal to the mod like I did should suffice?
Robin had released my post even before I logged my request / (complaint?) 🙂 They’re human and will certainly understand if the (perceived) violation wasn’t committed with maliciousness 🙂
certainly, it is:
add_filter( 'generate_get_the_title_parameters', function( $params ){
if ( bbp_is_forum_archive() ) {
$params = array(
'before' => sprintf(
'<h2 class="entry-title"%s">',
'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : ''
),
'after' => '</h2>',
);
}
return $params;
},10,1 );
ok so something like
add_filter ('generate_get_the_title_parameters' , 'rew_community', 10 , 1) ;
function rew_community ($params) {
if (is_page ('community')) {
$params = array(
'before' => sprintf(
'<h2 class="entry-title"%2$s><a href="%1$s" rel="bookmark">',
esc_url( get_page_by_title( 'community' ) ) ),
'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : ''
),
'after' => '</a></h2>',
);
}
return $params ;
}
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
Method 2
WP Page: Named Community
Slug Name: Community
Code within the page: [bbp-forum-index]
also, I forgot to include the function, here’s the full code that calls the issue:
function generate_get_the_title_parameters() {
if ( ! is_singular() ) {
$params = array(
'before' => sprintf(
'<h2 class="entry-title"%2$s><a href="%1$s" rel="bookmark">',
esc_url( get_permalink() ),
'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : ''
),
'after' => '</a></h2>',
);
}
return apply_filters( 'generate_get_the_title_parameters', $params );
}
ok, so which method in
Step by step guide to setting up a bbPress forum – Part 1
item 3
are you using to display this page?