How do I eliminate posts from a specific category in this list of posts?
-
I have created links at the top of my archive template, to all of the posts on that archive page (they are category archives). This works fine unless a post is listed in multiple categories – in that case, all the links from both categories are listed at the top of the page. Is there a way to eliminate postings from a specific category in the following code?
(code)`<?php
foreach( ( get_the_category() ) as $category ) {
$the_query = new WP_Query(‘category_name=’ . $category->category_nicename . ‘&showposts=5&offset=1’ );
while ($the_query->have_posts()) : $the_query->the_post();
?>- ” title=”<?php the_title(); ?>”><?php the_title(); ?>
<?php endwhile; ?>
<?php}?>`(/code)
I don’t understand the code enough to figure it out, have been looking at the documentation but the syntax isn’t explained well enough for a beginner like me – can anyone help? thanks –
- The topic ‘How do I eliminate posts from a specific category in this list of posts?’ is closed to new replies.