WordPress.org

Ready to get started?Download WordPress

Forums

Threaded Comments Problem - Markup wrong? (4 posts)

  1. Sherwin Techico
    Member
    Posted 5 years ago #

    All I can say is that this WP is dang fast. But the convertion of some pre-2.7 themes takes some sweat when you really want to have threaded comments =)

    I think I was able to convert this Blueprint theme to using it. However, I noticed that the markup for ol.commentlist goes like this--which I think is wrong(?)

    ol.commentlist
    __ li.comment
    __ li.comment
    __ ul.children
    __ li.comment

  2. Sherwin Techico
    Member
    Posted 5 years ago #

    Here's what I have in my functions.php that pertains to this update:

    ...
    add_filter( 'comments_template', 'legacy_comments' );
    function legacy_comments( $file ) {
    	if ( !function_exists('wp_list_comments') )
    		$file = TEMPLATEPATH . '/legacy.comments.php';
    	return $file;
    }
    ?>
    
    <?php
        function blueprint_comment($comment, $args, $depth) {
           $GLOBALS['comment'] = $comment; ?>
           <li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
                <div id="div-comment-<?php comment_ID(); ?>">
                    <div class="comment-author vcard">
                        <?php echo get_avatar(get_comment_author_email(), 48); ?>
                        <?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?>
                    </div>
                    <?php if ($comment->comment_approved == '0') : ?>
                    <em><?php _e('Your comment is awaiting moderation.') ?></em>
                    <br />
                    <?php endif; ?>
    
                    <div class="comment-meta commentmetadata small"><?php printf(__('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?> (<a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">#</a>)<?php edit_comment_link(__('(Edit)'),'  ','') ?></div>
    
                    <?php /*<p class="small"><?php comment_date('F jS, Y') ?> at <?php comment_time() ?> (<a href="#comment-<?php comment_ID() ?>" title="">#</a>) <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?></p>*/ ?>
    
                    <?php comment_text() ?>
    
                    <span class="reply small">
                        <?php comment_reply_link(array_merge( $args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
                    </span>
                </div>
            </li>
    <?php
        }
    ?>

    And here's what I have in my comments.php that pertains to the update:

    <?php if ( have_comments() ) : ?>
        <h2 id="comments"><?php comments_number('No Responses', 'Responses', 'Responses' );?></h2>
        <div class="small">
            <span class="feedlink"><?php comments_rss_link('Feed'); ?></span>
    		<?php if ('open' == $post-> ping_status) { ?><span class="trackbacklink"><a href="<?php trackback_url() ?>" title="Copy this URI to trackback this entry.">Trackback Address</a></span><?php } ?>
    	</div>
    
        <ol class="commentlist">
        	<?php wp_list_comments('type=comment&callback=blueprint_comment'); ?></ol>
        <div class="navigation">
            <div class="alignleft"><?php previous_comments_link() ?></div>
            <div class="alignright"><?php next_comments_link() ?></div>
        </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.
    	else : // comments are closed ?>
    	    <p class="nocomments">Comments are closed.</p>
    	<?php endif;
    endif; ?>
  3. Sherwin Techico
    Member
    Posted 5 years ago #

    Live example can be seen here: http://is.gd/biMR

    Pointers/help, etc. greatly appreciated. Thanks in advance.

  4. Sherwin Techico
    Member
    Posted 5 years ago #

    Blah... I'm just going to go along w/ this and call it a day.

    <?php wp_list_comments('avatar_size=48') ?>

    But if anyone had the time to do something like this, were you define your own .commentlist template via the hook and got it working like it should, please do let us know by updating this thread.

    TIA

Topic Closed

This topic has been closed to new replies.

About this Topic