[wp-hackers] if category exists

Daniel Cameron dan at sproutventure.com
Thu Mar 19 19:09:51 GMT 2009

Basically I have category links hardcoded into my theme template like so: <li
id="nav-linkt" <?php if (is_category('cat')) { echo "class=\"active_link\""
; } ?>>
<a href="<?php echo

which is fine but if the category doesn't exist (in the example above 'cat')
then the theme bombs.

Is there a way to wrap this list item with something like <?php if
category_exists { ?

I know that function doesn't exist but anything similar without having to
hard code a query?

Thanks all.

More information about the wp-hackers mailing list