I want display category description in wordpress (I'm using 2.6 version) and I try use <?php echo category_description(); ?>, but the category description can't display. But if I add category ID like this <?php echo category_description(5); ?>, the category description is show (can display). What is wrong?
Nothing is wrong. That is how the tag works. You need to use the "single_cat_title" tag in conjunction with the "category_description" tag for what you want. More info here.
I try using like this, but it's the same (can't display): <p><?php single_cat_title('Currently browsing'); ?> <?php echo category_description(); ?></p> New Info: I look at address browser, if ...../?cat=x category description show (can display) with category_description(). But if address browser like this: ....../?p=x category description can't display with category_description() script. My new Question now, how to display category description if at address browser like "?p=x" ?
single_cat_title only works outside the loop, and category_description only works on a category page if no category is given. Maybe that's wrong but that's how I read it. Do you want to show the category description for a post? Try this inside the loop: <?php $category = get_the_category(); echo category_description($category[0]->cat_ID); ?> Code (markup): It should show the first category description for a post. To show a description for each category, you'll need to make it loop through each one.