using get_the_category to get all post categories except one

foreach((get_the_category()) as $cat) {
if (!($cat->cat_name=='Featured')) echo $cat->cat_name . ' ';
}

this is what has been recommended in the forums but its not working for me. I need to split off the echo piece like the following to show an image.

<li><img src="<?php bloginfo('template_url'); ?>/images/cats/<?php echo $category->slug ?>-icon.png"/>  <?php  echo $category->cat_name ?> </li>

any ideas?

Related posts

Leave a Reply

1 comment

  1. Try this:

    foreach((get_the_category()) as $cat) {
        if ($cat->cat_name != 'Featured') {
            echo '<li><img src="' . get_bloginfo('template_url') . '/images/cats/' . $cat->slug . '-icon.png"/>' . $cat->cat_name . '</li>';
        }
    }