0

I'm building a scrolling page website and on that page I have comment form and some posts from different categories.

Comments applied to wrong post. Is there a way to choose the post I want ?

Thanks

3
  • Without knowing why the comments are applied to the wrong post, I don't know how to guess at an answer.
    – s_ha_dum
    Jan 30, 2014 at 21:48
  • Please edit your question to display your relevant code and where you are stuck. As written it is too broad to receive an accurate answer. Jan 30, 2014 at 21:52
  • It's not a duplicate (I think) since I'm trying to use comment_form($post_id) function and not apply filters. And "answered" page not giving an answer.
    – alexela
    Jan 31, 2014 at 0:55

1 Answer 1

0

Yes, you can pass the post ID you want to target to WordPress' comment_form() method.

Here's a good write up on the comment_form() method and here's the codex page on it.

3
  • Checking this! Hope it will work. That's exactly what I need
    – alexela
    Jan 30, 2014 at 22:05
  • No, not working. I'm posting it to comment_post(52); and then trying to read get_comments(array('post_id' => 52) getting with var_dump - array(0) { } What can be a problem? Thanks
    – alexela
    Jan 31, 2014 at 0:53
  • comment_post isn't a method, it's an action. The function/signature you want is comment_form( $args, $post_id ); Reread the first link in my answer.
    – Will
    Jan 31, 2014 at 18:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.