How can I display the type of custom post type in a template?
So: <h3> [CUSTOM POST TYPE] </h3>
?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityHow can I display the type of custom post type in a template?
So: <h3> [CUSTOM POST TYPE] </h3>
?
Already figured it out:
<?php $post_type = get_post_type_object( get_post_type($post->ID) );?>
<h3><?php echo $post_type->label ?></h3>
$post->post_type
no need to use get_post_type()
here as you already have the post object :)
– Sisir
Jul 8 '12 at 18:12