• HI,

    Please HELP. I made some changes to my comments.php file and now my comments section and links are all screwed up.

    1) Where the comment form used to be there is now a blank space. Is there a way to get rid of the blank space?

    2) when I click on “TWO COMMENTS” at the bottom of my first post, it takes me to the top of the page again. I want it to take me to the bottom where the comments are.

    3) When I click on “COMMENTS” at the bottom of my second post, It takes me to the top of the page and there is no comment form at all – no where to enter comments.

    Help please.
    thanks
    Lance
    My site is https://www.Lancesview.com and here is my comments.php file:

    <?php
    if (‘comments.php’ == basename($_SERVER[‘SCRIPT_FILENAME’]))
    die (__(‘Please do not load this page directly.’, ’emerald_stretch’));

    if (!empty($post->post_password)) {
    if ($_COOKIE[‘wp-postpass_’ . COOKIEHASH] != $post->post_password) {
    ?>
    <p><?php _e(‘This post is password protected. Enter the password to read comments.’, ’emerald_stretch’); ?></p>
    <?php
    return;
    }
    }
    $oddcomment = ‘alt’;
    ?>

    <div id=”respond”>

    <?php if ($comments) : ?>
    <h1><?php comments_number(__(‘No Responses’,’emerald_stretch’), __(‘One Response’,’emerald_stretch’), __(‘% Responses’,’emerald_stretch’)); //_e(‘ to “’,’emerald_stretch’); the_title(); _e(‘”’, ’emerald_stretch’); ?></h1>
    <div id=”comment-area”>

    <?php foreach ($comments as $comment) : ?>
    <li class=”<?php echo $oddcomment; ?> <?php if (function_exists(‘author_highlight’)) { ?> <?php author_highlight(); ?><?php } ?>” id=”comment-<?php comment_ID() ?>”>

    <p class=”commenter”><?php echo get_avatar( $comment, 48 ); ?> <?php comment_author_link() ?><span class=”comment-info”> – <?php comment_date(__(‘F j, Y’, ’emerald_stretch’)) ?></span></p>
    <?php if ($comment->comment_approved == ‘0’) : ?>
    <span class=”comment-moderation”><?php _e(‘??? Your comment is awaiting moderation ???’, ’emerald_stretch’); ?></span>
    <?php endif; ?>
    <?php comment_text() ?>

    <?php
    if (‘alt’ == $oddcomment) $oddcomment = ”;
    else $oddcomment = ‘alt’;
    ?>

    <?php
    if ( is_home() ) {
    static $comment_output_count = 0;
    $comment_output_count++;
    if ( $comment_output_count == 3 )
    break;
    }
    ?>

    <?php endforeach; ?>

    </div>

    <?php if ( !is_home() ) : ?>

    <?php if (‘closed’ == $post->comment_status) : ?>
    <!– <h3><?php _e(‘Comments are closed for this entry.’, ’emerald_stretch’); ?></h3> –>
    </div>
    <?php endif; ?>

    <?php else : ?>
    <?php if (‘open’ == $post->comment_status) : ?>
    <?php else : ?>
    <!– <h3><?php _e(‘Comments are closed for this entry.’, ’emerald_stretch’); ?></h3> –>
    </div>
    <?php endif; ?>
    <?php endif; ?>

    <?php if (‘open’ == $post->comment_status) : ?>

    <?php if ( is_home() ) : ?>’).style.visibility = ‘visible'”>Post comment<?php endif; ?>

    <?php if ( is_home() ) : ?>
    <div id=”comment-form-<?php the_ID(); ?>” style=”visibility: hidden;”>
    <?php else : ?>
    <div id=”comment-form”>
    <?php endif; ?>
    <h1><?php _e(‘Post a Comment’, ’emerald_stretch’); ?></h1>
    <?php if ( get_option(‘comment_registration’) && !$user_ID ) : ?>
    <p><?php _e(‘You must be’, ’emerald_stretch’); ?> /wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>”><?php _e(‘logged in’, ’emerald_stretch’); ?><?php _e(‘ to post a comment’, ’emerald_stretch’); ?>.</p>
    </div>
    <?php else : ?>
    <form action=”<?php echo get_option(‘siteurl’); ?>/wp-comments-post.php” method=”post” id=”commentform”>
    <?php if ( $user_ID ) : ?>
    <p><?php _e(‘Logged in as’, ’emerald_stretch’); ?> /wp-admin/profile.php”><?php echo $user_identity; ?>. <?php wp_loginout(); ?>.<!– /wp-login.php?action=logout” title=”<?php _e(‘Log out of this account’, ’emerald_stretch’); ?>”><?php _e(‘Log out ?’, ’emerald_stretch’); ?> –></p>
    <?php else : ?>
    <p><input type=”text” name=”author” id=”author” value=”<?php echo $comment_author; ?>” size=”30″ tabindex=”1″ <?php if ($req) echo “aria-required=’true'”; ?> />
    <label for=”author”><?php _e(‘Name’, ’emerald_stretch’); ?><?php if ($req) _e(‘, required’, ’emerald_stretch’); ?></label></p>
    <p><input type=”text” name=”email” id=”email” value=”<?php echo $comment_author_email; ?>” size=”30″ tabindex=”2″ <?php if ($req) echo “aria-required=’true'”; ?> />
    <label for=”email”><?php _e(‘Email (will not be published)’, ’emerald_stretch’); ?><?php if ($req) _e(‘, required’, ’emerald_stretch’); ?></label></p>
    <p><input type=”text” name=”url” id=”url” value=”<?php echo $comment_author_url; ?>” size=”30″ tabindex=”3″ />
    <label for=”url”><?php _e(‘Your Website (optional)’, ’emerald_stretch’); ?></label></p>
    <?php endif; ?>
    <p><textarea name=”comment” id=”comment” cols=”60″ rows=”10″ tabindex=”4″></textarea></p>
    <?php do_action(‘comment_form’, $post->ID); ?>
    <p>
    <input name=”submit” class=”button” type=”submit” id=”submit” tabindex=”5″ value=”<?php _e(‘Submit’, ’emerald_stretch’); ?>” />
    <input type=”hidden” name=”comment_post_ID” value=”<?php echo $id; ?>” />
    </p>
    </form>
    </div>
    <?php endif; ?>

    </div>
    <?php endif; ?>

    <?php else : ?>
    </div>
    <?php endif; ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • comments.php
    put an original back in
    make a back up
    then make changes

    Thread Starter lance007

    (@lance007)

    I don’t understand. Could you explain what you mean and why?

    Thanks

    I made some changes to my comments.php

    get a new one from your theme (wherever you have it saved or wherever you got it)
    put it on your site instead of the messed up one so it will work while you work on modifying it

    Thread Starter lance007

    (@lance007)

    I see, But the reason I made the changes was because I didn’t like the way the first one worked. So I would hate to go back to it.

    Can you look at my new post and see if you could help me please:
    “Sidebars Below Text”

    Thanks

    I see, But the reason I made the changes was because I didn’t like the way the first one worked.

    as long as you back up the file, play with it and test it all you want – there are plenty of help resources if you google for them
    there are also plugins for comment display
    you might like this
    https://www.instantshift.com/2009/02/08/30-most-wanted-wordpress-comments-page-hacks/

    Thread Starter lance007

    (@lance007)

    Thanks – will check out the link. I really do not want to go backwards. Must move forwards

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Comments all screwed up’ is closed to new replies.