Displaying Category Description from a Slug (category_description)

The WordPress Codex only covers circumstances when you need a category description from an ID or category_name.

Here’s a method for getting a category description based off a slug

<?php
echo category_description(get_category_by_slug('category-slug')->term_id);
?>

About the Author, Dan Cameron:

I'm the owner and solution engineer at Sprout Venture, a web solutions company that specializes in web development including WordPress.

I started my first blog in 2003 and transitioned to WordPress in 2004. Since moving to WordPress I've written a few plugins and themes for public consumption. Lately I'm busy engineering/building/coding and have only been able to share a few code snippets.

If you're in need of some web development, web design or custom WordPress plugins and/or themes contact me, I'll be happy to discuss it with you.

Read More »

blog comments powered by Disqus