echo category description in single.php

Try the code that follows the screenshot: (source: mikeschinkel.com) <?php $categories = get_the_category(); foreach($categories as $key => $category) { $url = get_term_link((int)$category->term_id,’category’); $categories[$key] = “<dt><a href=\”{$url}\”>{$category->name}</a></dt>” . “<dd>{$category->category_description}</dd>”; } echo “<dl>\n” . implode(“\n”,$categories) . “\n</dl>”; ?> Also, <?php echo category_description(the_category_id()); ?> doesn’t do what you think it does. What follows will work on your category … Read more

Is there an easy way to get a list of Category IDs?

there are some plugins that reveal the ID’s on the admin side like WP Show IDs and by code like this: //as dropdown $categories= get_categories(array(‘hide_empty’ => 0,’taxonomy’ => ‘category’)); echo ‘<select>’; foreach ($categories as $category) { $option = ‘<option value=”‘.$category->category_id.'”>’; $option .= $category->cat_name; $option .= ‘</option>’; echo $option; } echo ‘</select>’; //or just print the … Read more

how to “not” display new posts with a specific category on the main page?

There is even an example in the WordPress codex here for this: http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( ‘cat’, ‘-3,-8’ ); } } add_action( ‘pre_get_posts’, ‘exclude_category’ ); Just modify the category IDs (replace -3,-8 by your category IDs preceded by the minus sign) and put it in … Read more