Skip to content

Instantly share code, notes, and snippets.

@anatol06
Last active May 6, 2018 21:54
Show Gist options
  • Save anatol06/ed1ec274b5f5a5c95f403ec2655b18fb to your computer and use it in GitHub Desktop.
Save anatol06/ed1ec274b5f5a5c95f403ec2655b18fb to your computer and use it in GitHub Desktop.
WP - Comments Args and Form
<?php
$args = array(
'walker' => null,
'max_depth' => '',
'style' => 'ul',
'callback' => null,
'end-callback' => null,
'type' => 'all',
'reply_text' => 'Reply',
'page' => '',
'per_page' => '',
'avatar_size' => 80,
'reverse_top_level' => null,
'reverse_children' => '',
'format' => 'html5', // or 'xhtml' if no 'HTML5' theme support
'short_ping' => false, // @since 3.6
'echo' => true // boolean, default is true
); ?>
<?php wp_list_comments($args, $comments); ?>
<?php
$comments_args = array(
// change the title of send button
'label_submit'=>'Send',
// change the title of the reply section
'title_reply'=>'Write a Reply or 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); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment