Ich habe versucht die Kommentarfunktion zu den Beiträgen in mein template einzubauen, aber es wird nicht angezeigt unter den Beiträgen.
Code der Datei single.php:
PHP
<title>Willkommen in der Bücherlaube</title>
<?php get_header(); ?>
<div id="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div id="meta">
erstellt am: <?php the_date('d.m.Y'); ?> |
von: <?php the_author(); ?> |
Kategorie(n): <?php the_category(', '); ?></p>
</div>
<div class="entry">
<?php the_content(); ?>
</div>
<?php comments_template(); ?>
<?php endwhile; ?>
<p align="center"><?php next_posts_link('« Ältere Einträge') ?> <?php
previous_posts_link('Neuere Einträge »') ?></p>
<?php endif; ?>
</div>
<!-- main -->
<div id="sidebar">
<?php get_sidebar(); ?>
</div><!-- sidebar -->
<?php get_footer(); ?>
Alles anzeigen
Code der Datei comments.php
PHP
<div id="kommentar_formular">
<h3 id="respond">Kommentar schreiben</h3>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post"
id="commentform">
<p>
<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" />
<label for="author">Name</label>
</p>
<p>
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22"
tabindex="2" />
<label for="email">Email <small>(wird nicht veröffentlicht)</small></label>
</p>
<p>
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22"
tabindex="3" />
<label for="url">Webseite</label>
</p>
<p>
Kommentar
<textarea name="comment" id="comment" style="width: 100%;" rows="10" tabindex="4"></textarea>
</p>
<p>
<input name="submit" type="submit" id="submit" tabindex="5" value="Kommentar abschicken" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
</div> <!-- kommentar_formular -->
<div id="kommentare">
<?php foreach ($comments as $comment) : ?>
<div class="comment" id="comment-<?php comment_ID() ?>">
<small class="commentmetadata"><?php comment_author_link() ?> <strong>|</strong> am <?php
comment_date('j. F Y') ?> um <?php comment_time('H:i') ?> Uhr</small>
<?php comment_text() ?>
<?php if ($comment->comment_approved == '0') : ?>
<strong>Achtung: Dein Kommentar muss erst noch freigegeben werden.</strong><br />
<?php endif; ?>
</div>
<?php endforeach; /* end for each comment */ ?>
</div><!-- kommentare -->
Alles anzeigen
Der unfertige Blog:
http://www.buecherlaube.de
Was habe ich übersehen/falsch gemacht?