Based on the example on http://codex.wordpress.org/Function_Reference/get_categories, I try to run get_categories function on wordpress. But the result show nothing. Is it because of the new version wordpress 3.0?
<?php
$categories= get_categories('child_of=10');
foreach ($categories as $category) {
$option = '<option value="/category/archives/'.$category->category_nicename.'">';
$option .= $category->cat_name;
$option .= ' ('.$category->category_count.')';
$option .= '</option>';
echo $option;
}
?>
Need help on this one.
Thanks.
Are you sure that the category ‘soccer’ has the same ID on both servers (local and production)?
If you’ve manually added the categories on each, rather than copying the DB from one to the other, the ID’s for the same cat could be different.
In other words, are you sure the ‘soccer’ category ID is 10?
you might want to change it to this: