I'm thinking this might be a better example with code. The issue that I'd like to display posts that are in category a as the main condition. When that condition is met, then the loop would come into play outputting the category b.
In this example, the loop outputs category b:
Code PHP:
<?php query_posts('cat=b&showposts=1'); ?>
<?php $posts = get_posts('category=b&numberposts=1&offset=0');
foreach ($posts as $post) : start_wp(); ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php endforeach; ?>
So (and I know this isn't correct but I hope it visualizes the idea), what I'm looking to do is for the loop to take action if it belongs to category a (featured category), and if the entry is in category a, then display the entry that is in category a and also in category b which would in turn allow me to display one featured entry of each category:
Code PHP:
<?php if (cat_id == a) {
<?php query_posts('cat=b&showposts=1'); ?>
<?php $posts = get_posts('category=b&numberposts=1&offset=0');
foreach ($posts as $post) : start_wp(); ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php endforeach; ?>
} else {
// do something else
}
?>
Output example (where "featured" is category A), ergo displaying one featured entry for each category:
Edit: I think this is a lot more difficult than I had imagined. After lots of searching, I found the
Arthemia Theme which does exactly what I am trying to convey (see sidebar), so I think it's best if I purchase that theme.

Bookmarks