ich habe als Beispiel 5 Kategorien
möchte auf der Startseite jeweils drei Artikel aus jeweils einer der 5 Kategorien anzeigen,
das funktioniert,
wo ich ansteh und den Wald vor lauter Bäumen derzeit nicht sehe, ist:
kann ich außerdem noch den jeweils neuesten Artikel aus Kategorie 1 oder Kategorie 2 und
den jeweils neuesten Artikel aus Kategorie 3 oder 4 oder 5 anzeigen lassen?
das habe ich
PHP
<?php if (have_posts()) : ?>
<!-- erster loop category name 5-->
<h2>name 5</h2>
<ul>
<?php query_posts('category_name=5&showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<!-- zweiter loop ::category name 4 -->
<h2>name 2</h2>
<ul>
<?php query_posts('category_name=4&showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<!-- dritter loop ::category name 3 -->
<h2>name 3</h2>
<ul>
<?php query_posts('category_name=3&showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<!-- vierter loop ::category name 2 -->
<h2>name2</h2>
<ul>
<?php query_posts('category_name=2&showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<!-- fuenfter loop ::category name 1 -->
<h2>name1</h2>
<ul>
<?php query_posts('category_name=1&showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<?php else : ?>
<p>Leider nichts gefunden</p>
<?php endif; ?>
Alles anzeigen
hier ein Bild, das vielleicht besser veranschaulicht was ich mag
http://www.webdesign-in.de/wp-images/loopfrage.jpg
Danke
lG
Monika