I'm working on a site where I need to use the category name/description. On the home page, I need to display the category name and description of only the newest category created. I have this working as it should - except the information won't display *unless* there's a post within the category. I need the information to display pretty much as soon as the category is created, whether there's a post in it or not.
My (working) code looks like this:
<?php // custom query to show Newest Category
$new_query = new WP_Query('category_name=new_category&showposts=1');
while ($new_query->have_posts()) : $new_query->the_post();
?>
<?php
global $wpdb;
$newcat = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE term_id > 0 ORDER BY term_id DESC LIMIT 1");
query_posts("cat=$newcat");
?>
// stuff to display the category name and description here
Like I said, the above works *great* - but only if the newest category created has a post in it. Would anyone know how to fix that so if there's a new category, it'll show even though there's no posts associated with it?
Thanks :)