Enable comments under forums/topics
-
The plugin ‘bbPress Topics for Posts’ could’ve helped buy I’m getting an error when I activate it.
so what exact error message are you getting ?
Fatal error: Uncaught Error: Cannot use a scalar value as an array in ..\wp-content\plugins\bbpress-post-topics\index.php:924 Stack trace: #0 ..\wp-includes\class-wp-hook.php(287): bbppt_activate('') #1 ..\wp-includes\class-wp-hook.php(311): WP_Hook->apply_filters('', Array) #2 ..\wp-includes\plugin.php(484): WP_Hook->do_action(Array) #3 ..\wp-admin\plugins.php(193): do_action('activate_bbpres...') #4 {main} thrown in ..\wp-content\plugins\bbpress-post-topics\index.php on line 924
Edit: formatted for readability
thanks, I’ll take a look tomorrow
The plugin successfully activated once I moved to a live server, so that’s fine. But it’s not what I was looking for, am I missing something?
I’d like wordpress comments under forums or topics (single-forum.php or single-topic.php)
ok, I just released version 1.8.4 which for other new users should fix the error you were getting.
and you are correct, that plugin does forums under posts.
I know of nothing that does comments under forums, I am intrigued as to the reason for wanting this ?
It’s my site’s current layout, I have the forum or topic (depending on which page I’m on) on top and hopefully if I get a solution, the wordpress comments under
ok, still not sure why you want the ability for someone to comment on a forum page, or more strangely in a topic page??
but try setting up a page with the the same permalink as your forums root, and then put the shortcode
[bbp-forum-index]
in it
then set that page to have comments
it might work, it might not !
comment_status
isclosed
in these pages, wish I knew of a way to enable them.I got this from stackoverflow
function set_post_comment_status( $post_id, $status = 'open' ){ global $wpdb; $wpdb->update( $wpdb->prefix . 'posts', [ 'comment_status' => $status ], [ 'ID' => $post_id ] ); }
and tried passing the topic id, it didn’t work
Got the above from this stackoverflow thread
My problem is exactly like that except for bbpress
this turns comments on in bbpress
add_filter ('bbp_force_comment_status' , 'rew_set_comments_on') ; function rew_set_comments_on () { return true ; }
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
Another save by Robin! Thank you so much, this worked like a charm
great – glad you are fixed !!
- You must be logged in to reply to this topic.
athep
@athep
3 years, 9 months ago
I can’t see to get
<?php comments_template(); ?>
to work, it only outputs the stringcomments are closed.
The plugin ‘bbPress Topics for Posts’ could’ve helped buy I’m getting an error when I activate it.Is there a way I could enable comments on/under forum or topic pages?