Hallo allerseits,
ich will auf der Startseite meines Wordpress Blogs maximal einen Artikel (den neusten) pro Kategorie haben. Er soll also erkennen, dass die Kategorie bereits vorkam und daher alle
Weiteren Artikel dieser Kategorie ignorieren.
Hier mal mein Code:
PHP
<?php
if (have_posts()) :
$updates2 = new WP_Query('showposts=10&cat=-60,-61,-86,-85');
while ($updates2->have_posts()) : $updates2->the_post();
?>
<div class="m_up_el">
<a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">
<?php the_title(); ?>
<span>//</span>
<?php
foreach((get_the_category()) as $category) {
echo $category->cat_name . ' ';
}
?>
</a>
</div>
<?php endwhile; ?>
<?php else : ?>
Nichts gefunden
<?php endif; ?>
Alles anzeigen
Könnt Ihr mir da weiterhelfen?