Hallo,
ich habe folgenden Code für meine Startseite zum Darstellen von Beiträgen aus einer Kategorie verwendet:
PHP
<?php query_posts('cat=18&showposts=2'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div id="cover">
<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
<div class="tags"><?php st_the_tags();?></div>
<div class="the-following">The following postings could be interesting too:</div>
<div class="related-posts"><?php st_related_posts(""); ?></div>
<div class="posted-on">Posted on <?php the_time('F j, Y'); ?> under <?php the_category(', '); ?></div>
</div>
</div>
<div id="postmetadata">
<div class="alignright"><div class="p_comments"><?php comments_popup_link('Add comments', '1 comment', '% comments'); ?></div></div>
</div>
</div>
<?php endwhile; ?>
Alles anzeigen
Klappt wunderbar !
Nun möchte ich jedoch, dass darunter noch alle anderen angezeigt werden und zwar mit diesem Code:
PHP
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div id="cover">
<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
<div class="tags"><?php st_the_tags();?></div>
<div class="the-following">The following postings could be interesting too:</div>
<div class="related-posts"><?php st_related_posts(""); ?></div>
<div class="posted-on">Posted on <?php the_time('F j, Y'); ?> under <?php the_category(', '); ?></div>
Alles anzeigen
Ich habe alles mögliche versucht, aber ich schaffe es einfach nicht, diese beiden Codes untereinander zu bekommen, ohne dass er aussteigt und Fehler hinschreibt.
Kann mir bitte jemand sagen, wie es korrekt sein muss ?