A quick way to get the current category in your WordPress blog is by using this code:
foreach((get_the_category()) as $cat) {
$nameOfCategory = $cat->cat_name;
}
This small script will help you to exclude certain blog posts from showing on certain main categories. It was a life saver when developing the Olympus-Tours blog.


