• Resolved sheva29

    (@sheva29)


    Hello,

    There is this post about the difference between comments_template() and comment_form.

    That makes sense, from a hierarchical standpoint I’m not sure though. I’m creating my own WP template but the default fields that the form return are good enough for me. So I don’t need to do any customization, I just use CSS to style the default one, suing its classes and JS to add the ones that I want to add. I tried using the following in my single.php:

    // we display comments
    				$comments = get_comments(array(
    											// 'status' => 'approve',
    
    										   ));
    				$args = array(
    							'reverse_top_level' => false
    						);
    				wp_list_comments($args, $comments);
    
    				//we display the comments template
    				comment_form(); we use this as opposed to comments_template();

    This works partially, the only problem is that, it will display all my comments in every single post page. Not the comments that belong to a particular post. Can anyone provide more insights in why this is happening? I feel that I’m missing something. And also, if one could expand more on comments_template() vs comment_form() it will be highly appreciated it.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘comments_template() vs comment_form()’ is closed to new replies.