Skip to:
Content
Pages
Categories
Search
Top
Bottom

Enable comments under forums/topics

  • @athep

    Participant

    I can’t see to get <?php comments_template(); ?> to work, it only outputs the string comments 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?

Viewing 12 replies - 1 through 12 (of 12 total)
  • @robin-w

    Moderator

    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 ?

    @athep

    Participant
    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

    @robin-w

    Moderator

    thanks, I’ll take a look tomorrow

    @athep

    Participant

    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)

    @robin-w

    Moderator

    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 ?

    @athep

    Participant

    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

    @robin-w

    Moderator

    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 !

    @athep

    Participant

    comment_status is closed 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

    @athep

    Participant

    Got the above from this stackoverflow thread

    My problem is exactly like that except for bbpress

    @robin-w

    Moderator

    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

    Code Snippets

    @athep

    Participant

    Another save by Robin! Thank you so much, this worked like a charm

    @robin-w

    Moderator

    great – glad you are fixed !!

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Skip to toolbar