[wp-hackers] Category DB Changes in 2.1?

ryan fitzer ryanfitzer at gmail.com
Thu Feb 1 19:50:39 GMT 2007

I'm using the following code to place specific categories in the main nav of
a site in conjunction with wp_list_pages:

<li class="<?php if (is_category('2')) { ?>current_page_item<?php } else {
?>page_item<?php } ?>"><a href="?cat=2"><?php global $wpdb; $cat_name =
$wpdb->get_var("SELECT cat_name from $wpdb->categories WHERE cat_ID = 2");
echo $cat_name; ?></a></li>

For some reason, when viewing a category with the same ID as a page in the
main nav, the page gets class="page_item current_page_item" applied to it.
Never had this problem in 2.0. Any ideas?
Ryan Fitzer
Dallas, TX

More information about the wp-hackers mailing list