Noch einer eine andere Idee?
Hiermit geht es "halb":
if (get_comment_type() != 'comment') continue;
wenn es aber Pingbacks oder Trackbacks gibt, zeigt er diese zwar nicht an, geht aber im Theme davon aus.
Kann man diese evtl. noch entfernen?
Ich habe es in der functions.php getrennt:
// Kommentarliste
wp_list_comments(array('callback' => 'mts_comment'));
function mts_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
wenn ich jetzt aber "mts_comment" anstatt "comment" verwende, zeigt er nichts mehr an...?!
Hängt es evtl. hiermit zusammen:
<?php $comment_array = array_reverse(get_approved_comments($wp_query->post->ID)); $count = 1; ?>
Der ganze Code sieht übrigens so aus:
<?php $comment_array = array_reverse(get_approved_comments($wp_query->post->ID)); $count = 1; ?>
<?php if ($comment_array) { ?>
<?php comments_popup_link('Bisher keine Kommentare: <strong>Jetzt kommentieren!</strong>','Bisher <strong>1</strong> Kommentar - <strong>Jetzt kommentieren!</strong>','Die letzten der bisher <strong>%</strong> Kommentare - <strong>Jetzt kommentieren!</strong>'); ?>
<ul class="commentlist">
<?php foreach($comment_array as $comment){ ?>
<?php if (get_comment_type() != 'comment') continue; ?> <?php // if ($comment->comment_type != 'mts_comment') continue; ?>
<?php if (++ $count <= 4) { ?>
<li><a href="<?php comments_link(); ?>"><?php comment_excerpt(); ?></a> von <span><?php comment_author(); ?></span> am <?php comment_date(); ?></li>
<?php } ?>
<?php } ?>
</ul>
<?php } else { ?> <!-- if there was no comment in that post,yet -->
<?php comments_popup_link('Bisher keine Kommentare: <strong>Jetzt kommentieren!</strong>'); ?></div>
<?php } ?>
Alles anzeigen