i've got the newest post from each category displaying on the homepage. only there is one category that will always be tagged with two. Category 6 will always be also tagged with cat 12, however cat 12 will not always be tagged with 6.
on the homepage, the post in category 6/12 shows both category names. i want it to display only the category 6 name.
anyone know how to do this? here is the current loop
<!-- LATEST NEWS -->
<?php
$post_ids = array(0);
foreach( array(1,2,4,5,6,7,8,9,10,11,13,14,15,16,17) as $cat_id ) {
if ( $posts = get_posts(array('cat' => $cat_id, 'showposts' => 15)) ) {
$first = array_shift($posts);
$post_ids[] = $first->ID;
}
}
query_posts(array('post__in' => $post_ids));
?>
<?php while (have_posts()) : the_post(); ?>
<div class="latest-post-wrap">
<div class="latest-post">
<div class="latest-title">
<h2><?php the_category(' / ') ?></h2>
</div>
<div class="latest-image">
<a href="<?php the_permalink() ?>">
<?php if ( get_post_meta($post->ID, 'image', true) ) : ?>
<img src="<?php bloginfo('template_url'); ?>/mainimagecrop.php?w=162&h=118&f=<?php echo get_post_meta($post->ID, 'image', true) ?>" />
<?php endif; ?>
</a>
</div>
</div>
<div class="latest-content">
<span style="font-size:14px; color:#5CB7CC;font-weight:bold;text-transform:uppercase;"><br /><?php the_title(); ?></span><br />
<div class="postMeta-front">
<span class="date"><?php the_time('F j, Y') ?></span>
<span class="comments"><?php comments_popup_link('0', '1', '%'); ?></span>
</div>
<div class="clear"></div>
<p>
<?php
$excerpt = get_the_excerpt();
echo string_limit_words($excerpt,30);
?>
</p>
<p class="moretext"><a href="<?php the_permalink() ?>">Continue Reading...</a></p>
</div>
</div>
<?php endwhile; ?>
<!-- LATEST NEWS END -->