ich verzweifle
will eine Startseite haben, mit einer Tabelle in der die letzten Kommentare und Artikel angezeigt werden sollen. zwei Spalten.
Ich bekomme das einfach nicht hin. Hat vielleicht jemand einen Tip für mich?
Mein Template sieht zur zeit so aus.
PHP
<?php
/*
Template Name: Startseite
*/
?>
<?php get_header(); ?>
<div id="content">
<div>
<table border="1">
<?php
$posts = get_posts('numberposts=10order=ASC&orderby=post_date');
foreach($posts as $post) : ?>
<tr>
<td>
<?php the_time('j-F-Y') ?> <?php the_time ()?>
<br>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a>
<br>
<?php endforeach; ?>
</td>
<tr>
<?php $comments = $wpdb->get_results("SELECT comment_post_ID, comment_author, comment_author_email, comment_content, comment_date
FROM $wpdb->comments
WHERE comment_type = ''
&& comment_approved = '1'
ORDER BY comment_date
DESC LIMIT 10"); ?>
<?php $commenttype = 'even';
foreach($comments as $comment) {
$post = get_postdata($comment->comment_post_ID); ?>
<tr>
<td class="<?php echo $commenttype; ?>">
<?php echo $comment->comment_date; ?>
<br>
<?php echo $comment->comment_author; ?> zu <a href="<?php echo get_permalink($post['ID']); ?>” title=”"> <?php echo $post['Title']; ?></a>
</td>
</tr>
<?php if($commenttype == “even”) { $commenttype = “odd”; } else { $commenttype = “even”; } ?>
<?php } ?>
</table>
test
</div>
</div>
</div>
<?php get_footer(); ?>
Alles anzeigen
Das erzeugt aber nur eine Spalte mit jedemenge zeilen.
Lieben Dank
Dennis