admin管理员组

文章数量:1429519

I am looking for a way to embed WordPress comment form to watch.php in order to allow user to comment on a specific video. Can you tell me how?

I am looking for a way to embed WordPress comment form to watch.php in order to allow user to comment on a specific video. Can you tell me how?

Share Improve this question edited Feb 27, 2016 at 9:47 Sreng Pagna asked Feb 27, 2016 at 3:30 Sreng PagnaSreng Pagna 32 bronze badges 2
  • 5 What kind of problems do you have? Did you try to include <?php comments_template(); ?> at all in that template? See the Codex for more info. A little research is appreciated before even asking some! Btw are you misusing wordpress or is that a mistaken tag? – Charles Commented Feb 27, 2016 at 4:45
  • Comments can be done on some object. Video should be post-type or attachment. – Sumit Commented Feb 27, 2016 at 7:54
Add a comment  | 

2 Answers 2

Reset to default 1

Take a look at rendering a comment_form. You can render it anywhere in your page template and there are lots of ways to customize it.

$comments_args = array (
    // change the title of send button
    'label_submit'        => 'Send',
    // change the title of the reply section
    'title_reply'         => 'Leave Your Comment',
    // remove "Text or HTML to be displayed after the set of comment fields"
    'comment_notes_after' => '',
    // redefine your own textarea (the comment body)
    'comment_field'       => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><br /><textarea id="comment" name="comment" aria-required="true"></textarea></p>',
);

comment_form( $comments_args );

If the video is embedded in a normal post, you just switch on the option leave comments below your posts when editing or writing a post. You don't see that ? On the right of your edit post on top of the page, you can click on show/hide options. Check Comments.

本文标签: How can I embed comments plugin to my own website