Yes, I’ve tried the other shortcodes as well and the same issue happens with all of them
ok, thanks.
I cannot see why it would do this, unless it thinks it is a bbpress page and should add the sidebar.
Is it doing this for any bbpress shortcode – maybe as a test try some others and then come back
so which of the methods in this link item 3 are you using?
Step by step guide to setting up a bbPress forum – Part 1
Hi there,
Was there ever a fix found for this as I still have the depreciation warnings. I have tried both these plugins and neither work.
Deprecated: Creation of dynamic property BBP_Forums_Component::$members is deprecated in /website/wp-content/plugins/bbpress/includes/extend/buddypress/loader.php on line 149
Deprecated: Creation of dynamic property BBP_Forums_Component::$activity is deprecated in /website/wp-content/plugins/bbpress/includes/extend/buddypress/loader.php on line 153
Thank you in advance
You can see an example page now here:
http://bit.ly/4eG3RLY
The shortcode also uses the page title (where the shortcode is pasted) instead of the topic title.
Is it because of incompatibility with the theme?
Thanks for replying and yes, I am using the topic ID and it’s showing the correct topic.
The issue is that the shortcode is displaying the forum sidebar in addition to the topic.
You can see here a screenshot of the source code https://ibb.co/2PS9qW1
ok, not totally sure I understand.
so you are putting the actual topic_id in ?
eg
[bbp-single-topic id=265]
and not sure I understand what ‘it pulls the bbpress forum sidebar widget ‘ means – do you have a link to a live example?
I want to show a single topic on my homepage, on top of the page.
When I use the shortcode [bbp-single-topic id=$topic_id]
it pulls the bbpress forum sidebar widget as well. I am not sure if it’s incompatibility with the theme or normal behavior.
Is there PHP code I could use instead to pull a single topic? Maybe I could then use that to create a custom template for the homepage.
Thanks in advance
ok, so that error tells you it is a problem with the plugin gd-topic-polls
'call to undefined method xxxx in ...public_html/wp-content/plugins/gd-topic-polls'
That plugin is not written by bbpress and
GD Topic Polls: plugin for WordPress and bbPress Forums
says that the free version it is no longer being maintained.
There is a paid version at
https://www.dev4press.com/plugins/gd-topic-polls/
and if you have bought that version, then you need to raise a support ticket with them.
If you have the free version, then if you want to continue to use this plugin, you would need to buy the paid version
Hi there,
Test site latest updates and twenty four theme.
As explain in title I can’t display forum with 2024 and other blocks themes.
It’s ok to display forum list with shortcode but not forums.
Thanks four your help.
Hi Robin, thank you for replying quickly. Is there a shortcode (or even a php snippet) for adding a forum’s subscribe button to a template?
I am struggling with Search for my forum. The standard WP Search within my site works and includes results from the bbpress forums but only shows individual posts. I’d rather show links to the Topic, or at least have a link in the posts found to the topic.
So I tried to implement Search within the forum.
I tried using shortcode [bbp-search] but this changes nothing on the page. I tried the shortcode [bbp-search-form] on the page and got a search box but no matter what text I enter in there I only ever get the same single result which is the latest overall WP post, not a bbpress post.
I have set “Allow forum wide search” in settings.
What am I doing wrong?
ok, so which method atre you using in
https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/ item 3
if method 1, then try using method 2
We had a PHPBB many years ago, which we migrated to bbPress around four years ago, but it seems some flags remained in the database for the whole time, flags like (_bbp_class, _bbp_old_user_id, _bbp_password, _bbp_phpbb_user_avatar, _bbp_phpbb_user_sig). They might be needed; I have no idea.
But after the last update of WP and all the plugins, all the migrated users started to get an error message instead of being able to log in:
`
{“success”:false,”data”:[{“code”:”bbp_converter_db_connection_failed”,”message”:”Database connection failed”}]}
`
After some debugging and searching, I found https://bbpress.trac.wordpress.org/ticket/3419#no0 and tried to remove _bbp_class, which helped 🙂
I just needed to wipe the SQLite Object Cache
because it kept the old data. It might happen to someone else in the future, I don’t know. I don’t know if you can somehow influence that this metadata is not stored there or something else. But at least you have the information that it might happen.
sorry I did
add_action('bbp_new_forum_form', 'add_formation_field_to_forum_form');
Well it still doesn’t work, what if instead of that, I add a select on the form to create a forum, I create it also in the admin panel. how can I do that because I did
add_action('bbp_new_forum_form_after_content', 'add_formation_field_to_forum_form');
function add_formation_field_to_forum_form() {
$formations = get_terms(array(
'taxonomy' => 'formation',
'hide_empty' => false,
));
if (!empty($formations) && !is_wp_error($formations)) {
echo '<div class="bbp-form">
<label for="forum-formation">Sélectionner une formation :</label>
<select name="forum_formation" id="forum-formation">';
foreach ($formations as $formation) {
echo '<option value="' . esc_attr($formation->term_id) . '">' . esc_html($formation->name) . '</option>';
}
echo '</select>
</div>';
}
}
I want to link the forum to the taxonomy formation I think it should be more easier but in that way it doesn’t work I have linked formation to forum by doing
function link_formation_taxonomy_to_forums() {
register_taxonomy_for_object_type('formation', 'forum');
}
add_action('init', 'link_formation_taxonomy_to_forums');
ok so from the admin area I think you need to hook to
do_action( 'bbp_forum_attributes_metabox_save', $forum_id );
I did
add_action('bbp_new_forum_post_extras', 'my_custom_bbp_new_forum_handler');
function my_custom_bbp_new_forum_handler( $action = '' ) {
error_log('test function');
if ( 'bbp-new-forum' !== $action ) {
return;
}
if ( ! bbp_verify_nonce_request( 'bbp-new-forum' ) ) {
bbp_add_error( 'bbp_new_forum_nonce', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );
return;
}
do_action( 'bbp_new_forum_post_extras', $forum_id );
$forum_title = get_the_title($forum_id);
$forum_slug = sanitize_title($forum_title);
if (!term_exists($forum_title, 'forums')) {
$result = wp_insert_term($forum_title, 'forums', array(
'name' => $forum_title,
'slug' => $forum_slug
));
if (is_wp_error($result)) {
error_log("Erreur lors de l'insertion du terme : " . $result->get_error_message());
} else {
error_log("Terme de taxonomie 'forums' créé avec succès : " . print_r($result, true));
}
} else {
error_log("Le terme existe déjà : " . $forum_title);
}
$redirect_url = bbp_get_forum_permalink( $forum_id );
bbp_redirect( $redirect_url );
}
but it still doesn’t work the first error log doesn’t appear on the debug file
I think you need to hook to
do_action( 'bbp_new_forum_post_extras', $forum_id );
which is in the function bbp_new_forum_handler
Hello, I have a taxonomy forums that is is linked to the user, how can I do to create a forum on bbpress and when it’s done it also create a forum on my taxonomy
my code is :
function create_forum_taxonomy_entry($forum_id, $forum_args) {
$forum_title = get_the_title($forum_id);
$forum_slug = sanitize_title($forum_title);
error_log(“Création du forum : ” . $forum_title);
error_log(“Slug du forum : ” . $forum_slug);
// Insertion du forum dans la taxonomie forum
if (!term_exists($forum_title, ‘forums’)) {
$result = wp_insert_term($forum_title, ‘forums’, array(
‘slug’ => $forum_slug
));
if (is_wp_error($result)) {
error_log(“Erreur lors de l’insertion du terme : ” . $result->get_error_message());
} else {
error_log(“Term créé avec succès : ” . print_r($result, true));
}
} else {
error_log(“Le terme existe déjà : ” . $forum_title);
}
}
add_action(‘bbp_insert_forum’, ‘create_forum_taxonomy_entry’, 10, 2); but this function isn’t called
the file has another function below and it works so it’s not the calling of the file
This is not bbPress related. This is error in Avada theme, most likely due to outdated code that is not updated for PHP 8.x. This message is related to changes in PHP 8.1. You need to update Avada, or contact Avada author to fix the problem.
Is there an action I can use to execute PHP code before every bbPress page loads?
Then maybe I can try altering cookies to make bbPress switch languages.
I want language selection to be dynamic and user controlled.
Hello, George.
First of all, thanks for sharing that code modifications, it seems to fix the pagination for forums set up inside BuddyPress groups without any problem.
While following your instructions, I have a problem with the pagination between replies and I would like to ask you. For testing purposes, I have set a maximum of 2 replies per page for each topic. When I create a first reply, it is displayed without problem as topic content, but when I create a second reply, it is not displayed and a new page is not created for pagination. However, when I create a third reply, a new page is created showing the second reply and the third reply.
I think the problem could be with the initial content that is indicated when creating a topic. As you know, when you create a new topic you are asked for a title for that topic as well as some content as an introduction. When you enter the topic, this ‘introduction’ is displayed in the replies section but is not counted as a reply. So having set a maximum of 2 replies per page for each topic for testing, the first page shows the ‘introduction’ and replay 1, but when creating replay 2, as the same page is showing the ‘introduction’, this new reply is not shown and a second page is not created either as it detects only 1 replay on the first page.
How could this be solved? On the other hand, the pagination between topics works very well.
Thank you very much in advance, best regards.
If you look on the linked page and see a big white block, the oEmbed on my site isn’t working (when someone makes a post in bbPress, it automatically embeds it as shown on the page, but the link doesn’t work). Everything looks right, but the link doesn’t work. I can’t figure out what I can do to fix it or disable it. I’ve turned to a friend who knows how to code (I don’t) and she said that her bbPress installation has the same issue.
Here’s a page with an example:
Kirk Hunter Farewell Sale
Thanks for your help.
Hi Robin,
Thank you for replying.
I did find something that was said years ago about not putting the topic title into the reply record, not sure why.
So I create a record in the meta table, which is a custom field in the reply form using the following code and add the topic title as a custom field to the custom message in the Fs Poster plugin I am using to post to social media.
function check_and_populate_top_title_on_edit() {
global $pagenow;
// Check if we are in the post.php page (edit post/reply screen) and in the admin area.
if ($pagenow === 'post.php' && is_admin()) {
// Get the post ID from the URL query string.
$post_id = isset($_GET['post']) ? intval($_GET['post']) : 0;
// If we have a valid post ID, proceed.
if ($post_id) {
$post = get_post($post_id);
// Ensure we're working with a 'reply' post type.
if ($post && $post->post_type === 'reply') {
// Check if the post title is empty.
if (empty($post->post_title)) {
// Get the parent post ID.
$parent_post_id = $post->post_parent;
// Check if a parent post exists.
if ($parent_post_id) {
// Get the parent post data.
$parent_post = get_post($parent_post_id);
// If the parent post exists and has a title, update the 'top_title' custom field.
if ($parent_post && !empty($parent_post->post_title)) {
// Add or update the 'top_title' meta field with the parent post's title.
update_post_meta($post_id, 'top_title', $parent_post->post_title);
}
}
}
}
}
}
}
add_action('load-post.php', 'check_and_populate_top_title_on_edit');