I have created a page that uses custom posts: http://www.africanhealthleadership.org/resources/toolkit/
Each tool (Preparation, Assessment, etc.) is a custom post. On the WP Admin, each tool is a category; each category has a “description” field. I would like to output those descriptions on the Toolkit page. I tried using this and nothing displayed:
<?php echo category_description( $category ); ?>
Right now, the descriptions are hard-coded in to the page. The one for preparation begins
“Preparation tools establish…”
Thank you for any ideas!
Jeff
Here is the loop that spits out the custom post type:
<?php
query_posts( array( 'post_type' => 'portfolio', 'toolkit' => 'preparation' ) );
//the loop start here
if ( have_posts() ) : while ( have_posts() ) : the_post();
?>
<?php the_content(); ?>
<?php endwhile; endif; wp_reset_query(); ?>
And Here is the code from functions.php
add_action('init', 'portfolio_register');
function portfolio_register() {
$labels = array(
'name' => _x('Toolkit', 'post type general name'),
'singular_name' => _x('Tool', 'post type singular name'),
'add_new' => _x('Add New Tool', 'tool'),
'add_new_item' => __('Add New Tool'),
'edit_item' => __('Edit Tool'),
'new_item' => __('New Tool'),
'view_item' => __('View Tool'),
'search_items' => __('Search Toolkit'),
'not_found' => __('Nothing found'),
'not_found_in_trash' => __('Nothing found in Trash'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'menu_icon' => get_stylesheet_directory_uri() . '/article16.png',
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','thumbnail')
);
register_post_type( 'portfolio' , $args );
}
register_taxonomy("toolkit", array("portfolio"), array("hierarchical" => true, "label" => "Tool Categories", "singular_label" => "Tool", "rewrite" => true));