Getting “A variable mismatch has been detected.” error when trying to Move or Split a Topic or Reply as the Admin from the frontend. I’m using the most recent versions of BBPress, WordPress, PHP, and using the FreeLance Theme.
Any help appreciated.
Hi there
I recently installed bbPress on the WordPress website of our neighbourhood assistance.
We realy need this forum working since we have to coordinate assistance during the coronavirus lockdown here in Zurich (Switzerland).
It seems that there is a bug in regard to threaded replies. I checked out older topics in this support forum but nothing helped. Replies to replies do not work. if I click ‘Reply’, focus jumps to the bottom of the topic and the reply is placed there.
I appreciate any quick help very much so we can reach out to those who offer help and those who need assistance.
Wordpress: 5.3.2
Theme: Hestia
bbPress: 2.6.4
URL: https://zeitgut-zuerich.ch/forums/thema/nachbarschaftliche-unterstuetzung/
Wow…Thanks for these code.
I tested it on my test site with newmag wordpress theme by tagdiv and it worked.
But on the main site, I’m using Jnews Child theme. I tried it, but it did not work. Perhaps it because I don’t know which function.php to use; main theme or child theme funtion. Tried with child theme, but it did not work.
I’ve put that change in my site and submitted the patch in the trac. The best thing is that you reported this 4 months ago!! https://bbpress.trac.wordpress.org/ticket/3297
I’m checking this very old plugin
bbPress Go To First Unread Post
Isn’t this implemented by default in bbpress nowadays?
They may have quit working on it.
I did some digging through their code, and came up with something for you to try if you want.
You’ll add the below code to your theme’s functions.php
file, once you add the code and save the file. Reload your WordPress admin area by refreshing the page/browser, then remove the code and re-save the file.
Go to your discussions page, and try out that button(Apply settings to existing posts) again and see if it works for you.
if(!function_exists('bbppt_reset_topics_for_posts_meta_fix')){
function bbppt_reset_topics_for_posts_meta_fix(){
$args = array(
'meta_key' => 'bbpress_discussion_comments_copied',
'post_type' => 'post',
'post_status' => 'any',
'posts_per_page' => -1
);
$posts = get_posts($args);
if($posts){
foreach ($posts as $post) {
delete_post_meta( $post->ID, 'bbpress_discussion_topic_id');
delete_post_meta( $post->ID, 'bbpress_discussion_comments_copied');
$comments = get_comments( array( 'post_id' => $post->ID, 'order' => 'ASC' ) );
if($comments){
foreach ($comments as $comment) {
delete_comment_meta( $comment->comment_ID, 'bbppt_imported');
}
}
}
}
}
add_action( 'admin_init', 'bbppt_reset_topics_for_posts_meta_fix' );
}
Put this in your child theme’s function file – or use
Code Snippets
change the ‘-10 days’ to say ‘-90 days’ if you want 3 months
register_activation_hook(__FILE__, 'bbpress_topic_scheduler');
add_action('bbpress_daily_event', 'bbpress_close_old_topics');
function bbpress_topic_scheduler() {
wp_schedule_event(time(), 'daily', 'bbpress_daily_event');
}
function bbpress_close_old_topics() {
// Auto close old topics
$topics_query = array(
'author' => 0,
'show_stickies' => false,
'parent_forum' => 'any',
'post_status' => 'publish',
'posts_per_page' => -1
);
if ( bbp_has_topics( $topics_query ) )
while( bbp_topics() ) {
bbp_the_topic();
$topic_id = bbp_get_topic_id();
$last_active = strtotime( get_post_meta( $topic_id, '_bbp_last_active_time', true ) );
if ($last_active < strtotime( '-10 days') )
bbp_close_topic( $topic_id );
}
}
Writers Abroad
Wordpress version 5.3.2–en_GB
Is there a programme/plugin for Archive settings where I can archive topics after a given amount of time, e.g. 3 months, to tidy up forums?
Thanks in advance
Jo
if you want to improve the code, just add an item to my support page
https://wordpress.org/support/plugin/bbp-style-pack/
bbp style pack
once activated go to
dashboard>settings>bbp style pack>Forum Templates
bbp style pack
once activated go to
dashboard>settings>bbp style pack>Freshness Display
Hi,
Did you try asking the developer of that plugin?
You can post on their support page here:https://wordpress.org/support/plugin/bbpress-post-topics/, other users of that plugin might be able to help if you post on there.
Oh sorry, no it doesn’t do that, it just emails the user you mention.
This one https://wordpress.org/plugins/comment-mention/, seems to show the mentions block you’re wanting, but looks like it would need to be changed to work in the bbPress comment editor.
Sorry, I guess this is still an open ticket, right?
https://bbpress.trac.wordpress.org/ticket/3297
Hi there,
We seem to be getting some discrepancies around the panels which include the following for example:
—
‘This forum has 3 topics, and was last updated 3 weeks, 5 days ago by Name Surname.’
Viewing 4 topics – 1 through 4 (of 4 total)
—
Sadly on our set-up, these stats don’t seem to be matching up to the actual real edits, ie it states 3 topics, when there are 4, which you can see by the second line the system displays, it says ‘Viewing 4 topics’ yet above it says there are only 3 topics?
Is this standard, and maybe we are just misunderstanding what it’s counting? If anyone has any advise that would be so much appreciated :).
We are using:
– WordPress v: WordPress 5.3.2
– bbPress v: Version 2.6.4
– Sadly can’t include a link as it’s behind a login restricted area but we can liaise if anyone can help and facilitate this access
Thanks ever so much,
Tonya
not used elementor, but this should let you style bbpress
bbp style pack
The Divi Theme Builder Header is not loading on BBPress search results. Instead, it looks as though it is loading the default WordPress header.
Incorrect header
http://iytawebsite.staging.wpengine.com/forums/search/introductions/
Correct Header
Home
I contacted Elegant Themes already and they directed me here.
Thoughts?
Wordpress v5.3.2
BBPress v2.6.4
I suggest you install the plugin Snippets:
Code Snippets
Then you can create a snippet and put it there.
Put this in your child theme’s function file – or use
Code Snippets
Hello,
Easiest way would be to override the bbpress’s content-single-topic.php
file and move bbp_get_template_part( 'form', 'reply' );
to above bbp_get_template_part( 'loop', 'replies' );
within that file.
For another option, I’ve tried the below on a few different themes without any issues. You’d add the below code to your theme’s functions.php
file. Best if you add to child theme so that you don’t have to re-add if you update your theme, same would apply for the first option above.
if ( !function_exists( 'oscowordpress1_move_bbpress_reply_form_filter' ) ) {
function oscowordpress1_move_bbpress_reply_form_filter( $template , $slug , $name ) {
if ( is_array( $template ) && in_array( 'form-reply.php', $template ) ) {
remove_filter( 'bbp_get_template_part', 'oscowordpress1_move_bbpress_reply_form_filter', 10 );
return array();
}
return $template;
}
}
if ( !function_exists('oscowordpress1_move_bbpress_reply_form')){
function oscowordpress1_move_bbpress_reply_form( $slug, $name ){
if ( isset( $name ) && $name == 'replies' ) {
bbp_get_template_part( 'form', 'reply' );
add_filter( 'bbp_get_template_part', 'oscowordpress1_move_bbpress_reply_form_filter', 10, 3 );
}
}
add_action( 'get_template_part_loop', 'oscowordpress1_move_bbpress_reply_form', 10 ,2 );
}
Best of luck, and hope one of those work out for you. 🙂
I have zero knowledge of GamiPress…but let’s park that part of the question for a moment 🙂
Like WordPress itself, bbPress supplies a plethora of hooks that will let you write code that listens for various events—such a new topics being created or replies being added—at which point your code can scan for keywords and interact in various ways. I’m not sure exactly what you’re picturing, but having the bot add replies of its own or perhaps even trigger currency transfers in the context of GamiPress are all possibilities.
How easy this would be I guess really depends on what sort of tasks you want your bot to perform and what conditions you wish to be met before it performs them, but certainly bbPress/WordPress by themselves provide a nice foundation to build on top of.
The topics & replies within forums you can change in your WordPress admin area at Settings > Forums below “Topics and Replies Per Page”.
If you want to change the displayed forum amount(shortcode you mentioned), try adding the below code to your functions.php
file of your WordPress theme.
if(!function_exists('poco06_bbpress_change_forum_count_display')){
function poco06_bbpress_change_forum_count_display( $args ){
if( is_array( $args ) && array_key_exists( 'post_type', $args ) && $args['post_type'] == 'forum'){
$args['posts_per_page'] = 100; //Change to number of displayed you want
}
return $args;
}
add_filter( 'bbp_after_has_forums_parse_args', 'poco06_bbpress_change_forum_count_display' ,10 );
}
That should increase it to 100, change as needed. There might be a plugin for that as well that others may be able to point you to.
🙂
bbpress just uses WordPress login, so the issue lies with your site/wordpress