Add real comments support to Q&A

I'm wondering if there is a way to add real comments support to the questions and answers in the Q&A plugin. I noticed that when I was digging around in the code, the declarations for both custom post types have comments turned on, but the template files don't have any comment support in them for questions or answers.

On stackexchange, users are able to comment and discuss the merits of each individual question and answer. Would it be enough for me to add some template tags for a commenting section in the relevant template files and it would work? One of my clients wants to explore the possibility of giving users the ability to discuss the questions, in addition to, being able to provide answers for them.

Any thoughts on how to setup good commenting support for the two custom post types?

  • Corey Quick

    Hey @Saunt Valerian, Hope you are having a great day! :slight_smile:

    This can be done by using our Comments Plus Plugin as the commenting system. You can use other commenting systems too, but you will need to modify the code in that case.

    Just add this code to the functions.php of your theme:

    function my_qa_commentsplus() {
    	if ( !class_exists( 'Wdcp_PublicPages' ) )
    		return;
    	echo "<div style='clear:both; height:20px;'></div>";
    	// To customize, please see http://codex.wordpress.org/Function_Reference/comments_template
    	comments_template( );
    }
    add_action( 'qa_after_question_meta', 'my_qa_commentsplus' );

    This code will use comments.php of your theme, so it should be having the same look with other comments on your website, but you may need to check the exact usage by finding comments_template function in your theme. Or you may need to create another template file if you need a different look.

    Thanks,
    Corey

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.