I have a all my custom post types list together in blog format. What I’m trying to do is echo the post type name on each post.

I tried this:

get_post_type_object('post');
echo $obj->labels->singular_name;

But it just displayed “Post” for everything instead of the custom post type name

3 Answers
3

If you are within The Loop, try:

$post_type = get_post_type( $post->ID );
echo $post_type;

Does this work for you?

Leave a Reply

Your email address will not be published. Required fields are marked *