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?
2 Answers
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.
<?php comments_template(); ?>
at all in thattemplate
? See the Codex for more info. A little research is appreciated before even asking some! Btw are you misusing wordpress.com or is that a mistakentag
?