How 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.