Codex tools: Log in
Languages: English • Русский • 日本語 • (Add your language)
Contents |
Retrieve the post type of the current post or of a given post.
<?php echo get_post_type( $post ) ?>
Display the post type. This example needs to be inside the loop.
<?php echo 'The post type is: '.get_post_type( get_the_ID() ); ?>
Since: 2.1.0
get_post_type() is located in wp-includes/post.php.
Post Types: register_post_type(), add_post_type_support(), remove_post_type_support(), post_type_supports(), post_type_exists(), set_post_type(), get_post_type(), get_post_types(), get_post_type_object(), get_post_type_capabilities(), get_post_type_labels(), is_post_type_hierarchical(), is_post_type_archive(), post_type_archive_title()