File: /home/dtptviut/domains/julebloggen.dk/private_html/wp-content/themes/mts_socialnow/comments.php
<?php
// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if ( post_password_required() ) { ?>
<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'socialnow' ); ?></p>
<?php
return;
}
?>
<!-- You can start editing here. -->
<?php if ( have_comments() ) : ?>
<div id="comments">
<h4 class="total-comments"><?php comments_number(__('No Responses', 'socialnow' ), __('One Response', 'socialnow' ), '<span class="comm-number">%</span> '.__('Comments', 'socialnow' ) );?></h4>
<ol class="commentlist">
<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
<?php wp_list_comments('type=comment&callback=mts_comments'); ?>
<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
</ol>
</div>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments"></p>
<?php endif; ?>
<?php endif; ?>
<?php if( function_exists('get_avatar') && is_user_logged_in() ) {
$authorimg = get_avatar( get_the_author_meta('email'), '61' );
} else {
$authorimg = '<img src="' . get_stylesheet_directory_uri() . '/images/user-comm.png" width="61" height="61" />';
}
?>
<?php if ('open' == $post->comment_status) : ?>
<div id="commentsAdd">
<div id="respond" class="box m-t-6">
<?php
// Declare Vars.
$comment_send = esc_html__( 'Submit Comment', 'socialnow' );
$comment_reply = esc_html__( 'Join The Discussion', 'socialnow' );
$comment_reply_to = esc_html__( 'Reply', 'socialnow' );
$comment_author = esc_html__( 'Name*', 'socialnow' );
$comment_email = esc_html__( 'Email*', 'socialnow' );
$comment_body = esc_html__( 'Comment Text*', 'socialnow' );
$comment_url = esc_html__( 'Website', 'socialnow' );
$comment_cancel = esc_html__( 'Cancel Reply', 'socialnow' );
$comments_args = [
// Define Fields.
'fields' => [
// Author field.
'author' => '<p class="comment-form-author"><input id="author" name="author" aria-required="true" placeholder="' . $comment_author . '"></input></p>',
// Email Field.
'email' => '<p class="comment-form-email"><input id="email" name="email" placeholder="' . $comment_email . '"></input></p>',
// URL Field.
'url' => '<p class="comment-form-url"><input id="url" name="url" placeholder="' . $comment_url . '"></input></p>',
],
// Change the title of send button.
'label_submit' => $comment_send,
// Change the title of the reply section.
'title_reply' => $comment_reply,
// Change the title of the reply section.
'title_reply_to' => $comment_reply_to,
// Cancel Reply Text.
'cancel_reply_link' => $comment_cancel,
// Redefine your own textarea (the comment body).
'comment_field' => '<p class="comment-form-comment">' . $authorimg . '<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" placeholder="' . $comment_body . '"></textarea></p>',
// Message Before Comment.
'comment_notes_before' => '',
// Remove "Text or HTML to be displayed after the set of comment fields".
'comment_notes_after' => '',
'title_reply_before' => '<h4><span>',
'title_reply_after' => '</span></h4>',
// Submit Button ID.
'id_submit' => 'submit',
];
comment_form( $comments_args );
?>
</div>
</div>
<?php endif; // if you delete this the sky will fall on your head ?>