Hallo!
Ich mal wieder.
Ich rufe meine Kommentare per wp_list_comments wie folgt auf:
PHP
<?php } if (!empty($comments_by_type['comment'])) { ?>
<h2 id="comments"><div class="cptcount"><?php echo count($wp_query->comments_by_type['comment']); ?></div> Comments</h3>
<div class="hr hr_comment"></div>
<div class="commentlist">
<?php wp_list_comments('type=comment&callback=comments'); ?>
</div>
<br /><br /><br />
<?php } ?>
Alles anzeigen
Der Callback dazu ist (momentan noch):
PHP
function comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<div class="">
<div class="comment_gravatar_count">
<div class="gravatar">
<?php echo get_avatar( $comment, 32 ); ?>
</div>
</div>
<?php comment_author_link() ?>
<?php if ($comment->comment_approved == '0') : ?>
<em><?php _e('Your comment is awaiting moderation.') ?></em>
<br />
<?php endif; ?>
<div class="commenttext"><?php comment_text() ?></div>
<div class="commentmeta"> <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),' ','') ?></div>
</div>
<div style="clear:both;"></div>
<?php
}
Alles anzeigen
Nun möchte ich innerhalb dieses Callbacks eine Funktion/Variable, die mir die Kommentare durchnummeriert. Als ich das Ganze noch mit einer foreach-Schleife gelöst habe, ging es total einfach. Nur hier blick ich um's Verrecken nicht durch. Das ganze möchte ich aber ohne list-style lösen, da ich die Nummerierung gerne noch per CSS stylen kann.