Hallo,
weiß jemand wie man es im Sirus-Theme hinbekommt, dass nicht nur die letzten Kommentare der Beiträge angezeigt werden, sondern auch die der statischen Seiten?
Die Funktion um die es hier geht, müsste die hier sein:
PHP
function sirius_kommentare($no_comments = 5, $comment_lenth = 4, $before = '<li>', $after = '</li>', $show_pass_post = false) {
global $wpdb, $tablecomments, $tableposts, $sirius;
$request = "SELECT ID, comment_ID, comment_content, comment_author FROM $tableposts, $tablecomments WHERE $tableposts.ID=$tablecomments.comment_post_ID AND post_status = 'publish' ";
if(!$show_pass_post) { $request .= "AND post_password ='' "; }
$request .= "AND comment_approved = '1' ORDER BY $tablecomments.comment_date DESC LIMIT $no_comments";
$comments = $wpdb->get_results($request);
if ($sirius->option['kommentare'] == 'kommentarean') {
echo '<h2>'.__('Comments','sirius').' <a href="'. get_bloginfo('comments_rss2_url').'" title="RSS"><img src="'. get_bloginfo('template_directory').'/images/xml-medium.png" alt="RSS" /></a></h2><ul class="comment">'."\n";
$output = '';
foreach ($comments as $comment) {
$comment_author = stripslashes($comment->comment_author);
$comment_content = strip_tags($comment->comment_content);
$comment_content = stripslashes($comment_content);
$words=split(" ",$comment_content);
$comment_excerpt = join(" ",array_slice($words,0,$comment_lenth));
$permalink = get_permalink($comment->ID)."#comment-".$comment->comment_ID;
$output .= $before . '<strong>' . $comment_author . '</strong>: <a href="' . $permalink;
$output .= '" title="'.__('Comment by','sirius').' ' . $comment_author.'">' . $comment_excerpt . '...</a>' . $after;
}
echo $output;
echo '</ul><br/><br/><br/>'."\n";
}
}
Alles anzeigen
Vielen Dank schon mal im Vorraus.
Chet