How do I echo the custom post type name when viewing the archive or single post of that type? To grab the slug is,
<?php $queried_post_type = get_query_var('post_type'); ?>
But how in the world do I grab and echo the name?
How do I echo the custom post type name when viewing the archive or single post of that type? To grab the slug is,
<?php $queried_post_type = get_query_var('post_type'); ?>
But how in the world do I grab and echo the name?
From the Codex article on get_post_tyoes, I think you can use this:
$names = get_post_types(array('name' => get_query_var('post_type')),'names');
$queried_post_type = $names[0];This topic has been closed to new replies.