Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can I display the type of custom post type in a template?

So: <h3> [CUSTOM POST TYPE] </h3>?

share|improve this question
add comment

1 Answer

Already figured it out:

<?php $post_type = get_post_type_object( get_post_type($post->ID) );?>
<h3><?php echo $post_type->label ?></h3>
share|improve this answer
    
$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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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