Skip to content

Instantly share code, notes, and snippets.

@pochi-web pochi-web/comments.php Secret
Last active Nov 13, 2017

Embed
What would you like to do?
WordPress commnet.phpの作成
<?php
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$comments_args = array(
'fields' => array(
'author' =>
'<p class="comment-form-author"><label for="author">' . __( 'お名前', 'domainreference' ) . '</label> ' .
( $req ? '<span class="required">*</span>' : '' ) .
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) .
'" ' . $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'] ) .
'"' . $aria_req . ' /></p>',
'url' =>'',
)
);
?>
<?php comment_form($comments_args); ?>
<?php if ( have_comments() ) : ?>
<ol class="commentlist">
<?php wp_list_comments(); ?>
</ol>
<?php endif;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.