does removing this obvious part from you code snippet not work?
<?php the_category(', ') ?>
if not, you might be editing the wrong template.
If I remove the code you said I will not show any of the categories from the post. What I need is if the post has more than one category, let say, web and newsletter I will like only to show web.
I did it in my category section where I show all my categories except category 10 with this code:
<?php wp_list_categories('show_count=1&title_li=&exclude=10'); ?>
here I show all my categories and I hide category 10.
Thanks
won’t work with <?php the_category(', ') ?>
you could program something like (where 23 is the category id of the excluded cat):
<?php $cats = get_the_category();
if( $cats ) foreach( $cats as $cat ) {
$sep = '';
if( $cat->term_id != 23 ) {
echo $sep . '<a href="' . get_category_link( $cat->term_id ) . '">' . $cat->name . '</a>'; $sep = ', ';
}
}
?>
http://codex.wordpress.org/Function_Reference/get_the_category
Perfect.
Thank you, I love forums they are full of knowledge.