• For some reason, whenever someone tries to leave a comment, they get the error “Please fill the required fields (name, email). When I’m logged into my WordPress account, I can leave a comment. I tried re-uploading all of my files to the server, nothing. It was working a few weeks ago.

    I have also tried editing the wp-comments-post.php by replacing all of the “email” with “email2.” However, comments would not show up on the actual page and they would appear Anonymous. My website is annemarieladlad.info.

    Here is my comments.php file:

    <?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>This post is password protected. Enter the password to view comments.</p>
    <?php return;} /* This variable is for alternating comment background */$oddcomment = 'alt';?>
    
    <section id="comments" class="clearfix">
    
    <?php if ( have_comments() ) : ?>
    
    <h4>
    Thoughts (<?php comments_number('0', '1', '%' );?>)
    </h4>
    
    <?php foreach ($comments as $comment) : ?>
    
    <article id="commentlist" class="clearfix">
    <div class="information">
    <div id="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>" class="gravatar">
    <?php echo get_avatar( $comment, $size = '55'); ?></div>
    
    <h2 id="author"><a href="<?php comment_author_url(); ?>">
    <?php comment_author(); ?></a></h2>
    <h3 id="commentinfo">
    <?php comment_date('F j, Y') ?> | <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a> <br>
    <?php edit_comment_link('Edit Thought','',''); ?>
    </h3>
    </div>
    
    <div class="commentcontent">
    <?php if ($comment->comment_approved == '0') : ?>
    <em><?php _e('Your comment is awaiting moderation.'); ?></em>
    <?php endif; ?>
    
    <?php comment_text(); ?>
    
    <?php /* Changes every other comment to a different class */
    if ('alt' == $oddcomment) $oddcomment = '';
    else $oddcomment = 'alt';?>
    
    <?php endforeach; /* end for each comment */ ?>
    </div>
    
    <?php previous_comments_link() ?>
    <?php next_comments_link() ?>
    
    <?php else : // this is displayed if there are no comments so far ?>
    
    <?php if ('open' == $post->comment_status) : ?>
    <?php else : // comments are closed ?>
    <p>Comments are closed.</p>
    <?php endif; ?>
    
    <?php endif; ?>
    
    <?php if ('open' == $post->comment_status) : ?>
    
    </article>
    
    <div id="respond">
    
    <h5>
    <?php comment_form_title( 'Leave a Thought', 'Leave a Thought to %s' ); ?>
    </h5>
    
    <div class="cancel-comment-reply">
    <small><?php cancel_comment_reply_link(); ?></small>
    </div>
    
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
    <?php else : ?>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( $user_ID ) : ?>
    
    <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>
    
    <?php else : ?>
    
    <p><label for="author">Name <?php if ($req) echo "(required)"; ?></label><input type="text" name="name" id="name" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
    </p>
    
    <p><label for="email">Email (will not be published) <?php if ($req) echo "(required)"; ?></label><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
    </p>
    
    <p><label for="url">Website</label><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    </p>
    
    <?php endif; ?>
    
    <p>Thought
    <textarea name="comment" id="comment" cols="50%" rows="10" tabindex="4">
    </textarea>
    </p>
    
    <p>
    <input name="submit" type="submit" id="submit" tabindex="5" value="Submit" class="button" />
       <?php comment_id_fields(); ?>
    </p>
       <?php do_action('comment_form', $post->ID); ?>
    
    </form>
    
    <?php endif; // If registration required and not logged in ?>
    
    </div>
    
    <?php endif; ?>
    
    </section><!--END comments-->

    Please help! I’d really appreciate it.

Viewing 9 replies - 1 through 9 (of 9 total)
  • In Settings->Discussion, is the field Comment author must fill out name and e-mail checked ?

    Thread Starter annemarie5323

    (@annemarie5323)

    When it is checked, comments don’t work at all. Unless I change “email” to “email2” but then the author appears anonymous.

    When it isn’t checked, comments work but the author appears anonymous.

    I have also tried editing the wp-comments-post.php by replacing all of the “email” with “email2.”

    Never, EVER, edit WordPress core files. Re-upload a fresh unedited copy of that core file asap.

    Thread Starter annemarie5323

    (@annemarie5323)

    So I tried resetting my MySQL databases and re-uploading a fresh unedited of the core file. Nothing. :/

    Can you replicate the problem using the default Twenty Thirteen theme with all plugins deactivated?

    Thread Starter annemarie5323

    (@annemarie5323)

    Nope.

    So I’m guessing there’s a problem with my theme? ><

    I’m using Twenty Thirteen and I have this problem. I have not edited any core files.

    If the user is logged in, he/she sees this error message and loses whatever he/she typed.

    If the user is not logged in, he/she sometimes gets a dialog asking to resend data. Once that’s done, the page is redrawn inside the comment area — completely screwed up. OR the comment is never posted at all.

    Someone’s response on a closed thread was “fixed. jQuery placeholder.js was interfering with the enqueued comment script”

    I have no idea what this means.

    Help? Please?

    OKAY. The problem goes away when I disable JetPack.

    THANKS VERY MUCH, WordPress developers, for creating a plugin that causes your own theme to malfunction.

    @mlanger – please start your own thread if you need help – this thread is quite irrelevant – it’s referencing an old version of WP and a different theme.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘ERROR: please fill the required fields (name, email).’ is closed to new replies.