This is acturally for wordpress’s breadcrumb navagation, when we want to show the category for the current category, we can use the code below, just for record
<?php
foreach((get_the_category()) as $category) {
echo $category->cat_name . ' ';
}
?>
and you can replace the cat_name to be other category factors below
- cat_ID
- the category id (also stored as ‘term_id’)
- cat_name
- the category name (also stored as ‘name’)
- category_nicename
- a slug generated from the category name (also stored as ’slug’)
- category_description
- the category description (also stored as ‘description’)
- category_parent
- the category id of the current category’s parent. ‘0′ for no parents. (also stored as ‘parent’)
- category_count
- the number of uses of this category (also stored as ‘count’)
we can also use the code from wordpress directly,
<?php the_category(', '); ?>
<?php the_title(); ?>

January 12th, 2010 at 11:15 pm
Hi, I hope you don’t mind me posting here but I desperately need help. I’m advertising using Adwords, it used to be fine but it’s so expensive
February 17th, 2010 at 12:14 am
Cool, this just helped me alot on my site.