Hi,
bin grad dabei meine comments.php zu renovieren.
Meine Bisherige basierte auf dem alten classic-Theme.
Die Neue ist eine wüste Mischung aus der Twenty Ten comments.php, der zugehörigen ergänzten Funktion twentyten_comment in der functions.php und für die Ausgabe des Formulars ein Einschub vom Kubrick-Theme statt dem imho umständlich konfigurierbaren:
Klappt auch alles eigentlich so wie gewünscht.
Um die eigenen Kommentare hervorzuheben habe ich in der functions.php etwas ergänzt bzw. ausgetauscht:
function twentyten_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?
<!-- eingefügt-->
<?php if($comment->comment_author_email == get_the_author_email()) {
$class = "autor";
} else {
$class = "gast";
}?>
<!-- Ende eingefügt -->
<li id="li-comment-<?php comment_ID(); ?>" class="<?php echo $class; ?>">
<div id="comment-<?php comment_ID()?>">
Alles anzeigen
Normal sieht dieser Teil ja so aus:
function twentyten_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div id="comment-<?php comment_ID(); ?>">
Statt <?php comment_class(); ?> hebe ich halt class="<?php echo $class; ?>" reingewurstet.
Klappt eigentlich auch. Die entsprechenden Klassen werden ganz brav in Abhängigkeit von Autor oder Gast ausgegeben und ich könnte entsprechend gestalten.
Jetzt habe ich aber in der Wp-Doku unter comment_class folgendes gelesen:
Zitatuser_id: if the comment was made by a registered user, then adds class "byuser" and "comment-author-" + the user_nicename sanitized (i.e. spaces removed). Also, if the comment is by the original author of the post, the class "bypostauthor" is added.
Es ist mir leider nicht gelungen das so einzubauen, um die Klasse bypostauthor ausgegeben zu bekommen.
Kann mir evtl. jemand auf die Sprünge helfen?
Meine PHP-Kenntnisse sind leider nur rudimentär. :-)