Hallo, miteinander!
Schicke mal Folgendes voraus: Ich bin neu hier und erstelle derzeit zum ersten Mal ein Theme in Wordpress, hatte vorher noch nie mit Wordpress + php zu tun. Kam mittels zahlreicher, fleißig studierter Anleitungen im Web gut voran, aber das folgende Problem konnte ich alleine leider nicht lösen, also brauche ich eure freundliche Hilfe:
Das Ziel war, Gravatare einzubinden und Autoren-Kommentare anders darzustellen. Funktioniert in FF2 tadellos und wird richtig angezeigt. IE7 zeigt aber nur für jeden 2. Kommentar einen Gravatar an. Was muss ich ändern, damit das auch in IE (und anderen Browsern) klappt? Hier der entsprechende Abschnitt aus comments.php:
<?php
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Bitte diese Seite nicht direkt aufrufen. Danke!');
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 class="nocomments">Auch die Kommentare sind durch das Passwort geschützt.</p>
<?php
return;
}
}
/* This variable is for alternating comment background */
$oddcomment = 'class="alt" ';
?>
<?php if ($comments) : ?>
<h4 id="comments"><?php comments_number('Keine Reaktion', 'Eine Reaktion', '% Reaktionen' );?> zu “<?php the_title(); ?>”</h4>
<ol class="commentlist">
<?php foreach ($comments as $comment) : ?>
<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>"<?php global $comment;
if ( ($comment->comment_author_email == get_the_author_email()) && ($comment->user_id != 0) )
{echo " class=\"autor_kommentar\"";} else {echo " class=\"" . $oddcomment . "\"";} ?>>
<!--avatar wird geholt-->
<?php echo get_avatar( $comment, 32 ); ?>
<cite><span class="author"><?php comment_author_link() ?> am <a href="#comment-<?php comment_ID() ?>" title=""></a><?php comment_date('j. F Y') ?> um
<?php comment_time() ?> Uhr |<?php edit_comment_link('Bearbeiten',' ',''); ?></span></cite><!--autor, datum und zeit-->
<?php if ($comment->comment_approved == '0') : ?>
<br /><strong>Achtung: Der Kommentar muß erst noch freigegeben werden.</strong>
<?php endif; ?>
<?php comment_text() ?>
</li>
<!--jeden zweiten kommentar verschieden stylen-->
<?php $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : ''; ?>
<?php endforeach; /* end for each comment */ ?>
</ol>
Alles anzeigen
Und noch eine zusätzliche Frage: Wie und wo müsste ich einen Pfad für einen eigenen default-Gravatar einbinden?
URL kann ich leider keine anbieten, ich arbeite derzeit mit xampp, das Theme liegt also nur auf meiner Festplatte (was sich allerdings in ein paar Tagen ändern sollte).
Hoffe es findet sich eine freundliche Seele, die einem Neuling hilft! :)
Grüaßle, gsibergerin!