Skip to content

Instantly share code, notes, and snippets.

@danielpataki
Last active March 9, 2022 13:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save danielpataki/4d0ef6575ab96a4ec5c4 to your computer and use it in GitHub Desktop.
Save danielpataki/4d0ef6575ab96a4ec5c4 to your computer and use it in GitHub Desktop.
$args = array(
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>'
'fields' => apply_filters( 'comment_form_default_fields', array(
'author' =>
'<p class="comment-form-author">' .
'<label for="author">' . __( 'Name', 'domainreference' ) . '</label> ' .
( $req ? '<span class="required">*</span>' : '' ) .
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) .
'" size="30"' . $aria_req . ' /></p>',
'email' =>
'<p class="comment-form-email"><label for="email">' . __( 'Email', 'domainreference' ) . '</label> ' .
( $req ? '<span class="required">*</span>' : '' ) .
'<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) .
'" size="30"' . $aria_req . ' /></p>',
'url' =>
'<p class="comment-form-url"><label for="url">' .
__( 'Website', 'domainreference' ) . '</label>' .
'<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .
'" size="30" /></p>'
)
);
comment_form( $args );
<form action="http://danielpataki.local/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate="">
<p class="comment-notes">
Your email address will not be published. Required fields are marked
<span class="required">
*
</span>
</p>
<p class="comment-form-author">
<label for="author">
Name
<span class="required">
*
</span>
</label>
<input id="author" name="author" type="text" value="" size="30" aria-required="true">
</p>
<p class="comment-form-email">
<label for="email">
Email
<span class="required">
*
</span>
</label>
<input id="email" name="email" type="email" value="" size="30" aria-required="true">
</p>
<p class="comment-form-url">
<label for="url">
Website
</label>
<input id="url" name="url" type="url" value="" size="30">
</p>
<p class="comment-form-comment">
<label for="comment">
Comment
</label>
<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true">
</textarea>
</p>
<p class="form-allowed-tags">
You may use these
<abbr title="HyperText Markup Language">
HTML
</abbr>
tags and attributes:
<code>
&lt;a href="" title=""&gt; &lt;abbr title=""&gt; &lt;acronym title=""&gt; &lt;b&gt; &lt;blockquote cite=""&gt; &lt;cite&gt; &lt;code&gt; &lt;del datetime=""&gt; &lt;em&gt; &lt;i&gt; &lt;q cite=""&gt; &lt;strike&gt; &lt;strong&gt;
</code>
</p>
<p class="form-submit">
<input name="submit" type="submit" id="submit" value="Post Comment">
<input type="hidden" name="comment_post_ID" value="1429" id="comment_post_ID">
<input type="hidden" name="comment_parent" id="comment_parent" value="0">
</p>
</form>
<?php comment_form( $args, $post_id ); ?>
@Gnanalingam
Copy link

thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment