WordPress.org

Ready to get started?Download WordPress

Forums

How to indent comment replies (7 posts)

  1. RSin12
    Member
    Posted 1 year ago #

    I'm looking for support in improving the formatting of comments on my wife's blog. Below link has a handful of comments.

    http://mommyunmuted.com/target-twelve-step-program/

    As you can see they look like crap, and you can't tell a comment from a reply to a comment. Can anyone make any recommendations on:

    1) How to indent reply comments?
    2) Plugins that will help format comments?

    Many thanks!

  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

    have you checked 'Enable threaded (nested) comments [ ] levels deep' under dashboard - settings - discussion ?

    it seems that right now, all your comments are on one level.

  3. RSin12
    Member
    Posted 1 year ago #

    Yes, this has been checked and is set to 5 levels deep. Was really hoping it was something as simple as forgetting that. :)

  4. alchymyth
    Forum Moderator
    Posted 1 year ago #

    as you are using a home-made theme, you are in full control, however, nobody can easily check anything in your theme.

    there are definitively no 'reply' buttons with the individual comments;
    none of the comments seems to be a reply to any of the other comments...

    what is the code of comments.php?

  5. RSin12
    Member
    Posted 1 year ago #

    Yeah, I had a couple of friends help me get this site put together for my wife, and it seems to be a little "hacky". The only true replies we have in there are done by my wife through wordpress dashboard. When testing Disqus plugin, these appeared correctly, so at this point, I thinking the only real way to do this easily is with a plugin (like Disqus).

    comments.php is below.. I hope it all fits :)

    Thanks for your help!

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <?php
    /**
     * @package WordPress
     * @subpackage Classic_Theme
     */
    
    if ( post_password_required() ) : ?>
    <p><?php _e('Enter your password to view comments.'); ?></p>
    <?php return; endif; ?>
    
    <?php if ( $comments ) : ?>
    <ol id="commentlist" class="commentlist">
    
    <?php foreach ($comments as $comment) : ?>
    	<li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
    
    	<?php comment_text() ?>
    	<cite> <?php echo get_avatar( $comment, 20 ); ?> <?php comment_type(_c('Comment|noun'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> <?php comment_author_link() ?> — <?php comment_date() ?> @ <a>"><?php comment_time() ?></a><?php edit_comment_link(__('Edit This'), '<strong class="edit">', ''); ?> </cite>
    
    <?php endforeach; ?>
    
    <?php else : // If there are no comments yet ?>
    <?php endif; ?>
    
    <?php if ( comments_open() ) : ?>
    <h2 id="postcomment"><?php _e('Leave a comment'); ?></h2>
    
    <p class="comment-trackback"><?php post_comments_feed_link(__('<abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.')); ?>
    <?php if ( pings_open() ) : ?>
    	<a>" rel="trackback"><?php _e('TrackBack <abbr title="Universal Resource Locator">URL</abbr>'); ?></a>
    <?php endif; ?>
    </p>
    
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), get_option('siteurl')."/wp-login.php?redirect_to=".urlencode(get_permalink()));?></p>
    <?php else : ?>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( $user_ID ) : ?>
    
    <p class="comments_logged-in"><?php printf(__('Logged in as %s.'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>'); ?> <a>" title="<?php _e('Log out of this account') ?>"><?php _e('Log out »'); ?></a></p>
    
    <?php else : ?>
    
    <p><input class="text"  type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
    <label for="author"><?php _e('Name'); ?> <?php if ($req) _e('(required)'); ?></label></p>
    
    <p><input class="text"  type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
    <label for="email"><?php _e('Mail (will not be published)');?> <?php if ($req) _e('(required)'); ?></label></p>
    
    <p><input class="text"  type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    <label for="url"><?php _e('Website'); ?></label></p>
    
    <?php endif; ?>
    
    <?php
    global $options;
    foreach ($options as $value) {
        if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; }
          else { $$value['id'] = get_settings( $value['id'] ); }
    } ?>
    
    <?php if ($theme_comment_htmltags=="Enable") { ?>
    <p class="allowed"><small> <?php printf(__('You can use these XHTML tags: %s'), allowed_tags()); ?></small></p>
    <?php } ?>
    
    <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
    
    <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php echo attribute_escape(__('Submit Comment')); ?>" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    
    </form>
    
    <?php endif; // If registration required and not logged in ?>
    
    <?php else : // Comments are closed ?>
    <div class="post">
    	<p><?php _e('Sorry, the comment form is closed at this time.'); ?></p>
    </div>
    <?php endif; ?>
  6. alchymyth
    Forum Moderator
    Posted 1 year ago #

    a comments.php for treaded comments would best use wp_list_comments() to show the comments list;
    http://codex.wordpress.org/Function_Reference/wp_list_comments

    have a look around in more recent themes to find examples.

  7. RSin12
    Member
    Posted 1 year ago #

    Thank you, alchymyth. I'll dig through there.

Topic Closed

This topic has been closed to new replies.

About this Topic