• I’m having trouble with comments on my blog (http://www.p-alma.miguelcoelho.com). Comments author’s name don’t show and I’ve tried changing themes and it works.

    I would like to stick to my current theme but I’d love to have this fixed.

    Can anyone help me?

    `<?php // Do not delete these lines
    if (‘comments.php’ == basename($_SERVER[‘SCRIPT_FILENAME’]))
    die (‘Please do not load this page directly. Thanks!’);

    if (!empty($post->post_password)) { // if there’s a password
    if ($_COOKIE[‘wp-postpass_’ . COOKIEHASH] != $post->post_password) { // and it doesn’t match the cookie
    ?>

    <p>This post is password protected. Enter the password to view comments.<p>

    <?php
    return;
    }
    }

    /* This variable is for alternating comment background */
    $oddcomment = ‘comment’;
    ?>

    <!– You can start editing here. –>

    <?php if ($comments) : ?>

    <h2><?php comments_number(‘Sin comentários’, ‘Un comentário’, ‘% comentários’ );?></h2>

    <?php foreach ($comments as $comment) : ?>

    <div class=”comment wrap” id=”comment-<?php comment_ID() ?>”>
    <div class=”col-left”>

    <p><?php comment_author() ?>
    </p>
    <p><i> <?php comment_date(‘M jS, Y’); ?></i>
    <?php edit_comment_link(‘Edit comment’, ”, ”); ?></p>

    </div>
    <div class=”col-right”>
    <?php comment_text() ?>
    <?php if ($comment->comment_approved == ‘0’) : ?>
    <p>Your comment is awaiting moderation.</p>
    <?php endif; ?>
    </div>
    </div>

    <?php /* Changes every other comment to a different class */
    if (‘comment’ == $oddcomment) $oddcomment = ‘alt’;
    else $oddcomment = ‘comment’;
    ?>

    <?php endforeach; /* end for each comment */ ?>

    <?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”>Comments are closed.</p>–>

    <?php endif; ?>
    <?php endif; ?>

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

    <h2>Comentar</h2>

    <?php if ( get_option(‘comment_registration’) && !$user_ID ) : ?>
    <h2>You must be /wp-login.php?redirect_to=<?php the_permalink(); ?>”>logged in to post a comment.</h2>
    <?php else : ?>

    <form action=”<?php echo get_option(‘siteurl’); ?>/wp-comments-post.php” method=”post” id=”commentform”>
    <div>
    <?php if ( $user_ID ) : ?>
    <p class=”lc_logged”>Logged in as /wp-admin/profile.php”><?php echo $user_identity; ?>. /wp-login.php?action=logout” title=”Log out of this account”>Logout</p>
    <?php else : ?>

    <label for=”author” class=”wrap”><input type=”text” id=”author” value=”<?php echo $comment_author; ?>” size=”27″ tabindex=”1″ /> <span>Nombre <?php if ($req) echo “(obligatório)”; ?></span></label>
    <label for=”email” class=”wrap”><input type=”text” id=”email” value=”<?php echo $comment_author_email; ?>” size=”27″ tabindex=”2″ /> <span>Email <?php if ($req) echo “(obligatório)”; ?> – no será publicado</span></label>
    <label for=”url” class=”wrap”><input type=”text” id=”url” value=”<?php echo $comment_author_url; ?>” size=”27″ tabindex=”3″ /> <span>Web (opcional)</span></label>

    <?php endif; ?>

    <!–<p><small>XHTML: You can use these tags: <?php echo allowed_tags(); ?></small></p>–>

    <textarea name=”comment” rows=”10″ cols=”50″ tabindex=”4″></textarea>

    <input name=”submit” type=”image” id=”submit” tabindex=”5″ src=”<?php bloginfo(‘template_directory’); ?>/images/img_leave_comment.gif” />

    <input type=”hidden” name=”comment_post_ID” value=”<?php echo $id; ?>” />

    <?php do_action(‘comment_form’, $post->ID); ?>
    </div>
    </form>

    <?php endif; // If registration required and not logged in ?>

    <?php endif; // if you delete this the sky will fall on your head ?>

Viewing 15 replies - 1 through 15 (of 17 total)
  • see this:

    <?php comment_author() ?>

    it needs to be this:

    <?php comment_author(); ?>

    Thread Starter miguelcoelho

    (@miguelcoelho)

    I’ve just tried that and it doesn’t work also…

    What else could be?

    Thanks anyway!!

    Please approve the 2 comments that i just added so that I can see.

    Thread Starter miguelcoelho

    (@miguelcoelho)

    done! they show as “anonymous”…

    ok. did you buy that theme? its a ‘premium’ theme, why arent you asking the theme author?

    did you make changes to the comments.php? The orignal theme does display the comment author’s name, so you know you had to have changed something.

    Either put back the original file. or explain what you have changed. Even better than explaining is making BOTH files available for someone to look at.

    Thread Starter miguelcoelho

    (@miguelcoelho)

    ok… I’ll do that…

    I just thought that here it would be easier and faster!

    you’ll do what?

    contact the author? ok. I only mention it because you paid.. you ought to GET support you paid for 🙂

    On the other hand, if you made changes to the file, whoever you talk to isnt going to want to help.

    Did you make changes to the file???

    Thread Starter miguelcoelho

    (@miguelcoelho)

    I’ve just translated a couple of things… but i guess I didn’t changed nothing crucial as I have the same problem with the original file…

    Thread Starter miguelcoelho

    (@miguelcoelho)

    I just can’t figure it out….

    hmm, if the original download you got doesnt display the author, BUT the default theme does — I would hightail it over to the theme author’s site.

    Thread Starter miguelcoelho

    (@miguelcoelho)

    no… default theme also doesn’t display the author…

    this is the problem!!
    🙂

    We can see that the author names is displayed before the january 4th…

    Did you make any change at this time?

    I also posted a test comment…

    Just wondering… Maybe… The default theme doesn’t show the author names for comments already recorded…

    But it you switch to the default theme, maybe new comments will be OK…

    Could you switch to the default theme just for few minutes and then we could post some new comments with the default comment template file…

    S.

    Thread Starter miguelcoelho

    (@miguelcoelho)

    I’ve just switched to the default theme… and the comments now display the author…

    what should I do now? Any idea?

    What do you mean?

    Is the author name is displayed for comments already recorded. like the test we made today ?

    Or the author name is displayed for new comments recorded with the default theme ?

    ——-
    Replace the file comments.php with a fresh one from your theme.

    Make some new tests to see if the names are displayed.

    If it doesn’t solve the problem, ask the theme author… I read here you paid for this theme…

    ——

    Another option : replace the comments.php of your theme with the one you will find in the wordpress default theme.

    S.

    Thread Starter miguelcoelho

    (@miguelcoelho)

    I guess the last option is the best…

    Then I would only need to tweak the css to match my theme. Is that difficult?

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Can’t view comments author’s name’ is closed to new replies.