Codex tools: Log in
Languages: English • 日本語 • (Add your language)
wp-includes/deprecated.php.
Use any of these functions instead.Contents |
Displays or returns the numeric ID of the category a post belongs to. This tag must be used within The Loop.
This tag was deprecated when multiple categories were added to WordPress, and there is no one-to-one correspondence with another tag. This PHP code block provides an example for how you can replace it:
<?php
foreach((get_the_category()) as $category) {
echo $category->cat_ID . ' ';
} ?>
<?php the_category_ID( $echo ); ?>
Displays a corresponding image for each category.
<img src="<?php the_category_ID(); ?>.gif" />
Categories: the_category(), the_category_rss(), single_cat_title(), category_description(), wp_dropdown_categories(), wp_list_categories(), get_the_category(), get_the_category_by_ID(), get_category_by_slug(), get_the_category_list(), get_category_parents(), get_category_link(), is_category(), in_category()