I’m trying to pull a custom post type name/title out for use in the breadcrumb of a single-[cpt].php template file.
In the archive-[cpt].php I can use post_type_archive_title() and it echo the name.
How would I get this same title in a single view?
Thanks!
I’ve trawled though the codex and haven’t seen a function, but might have missed it!
There doesn’t appear to be one, but the following should work:
This can, for instance, be put in one generic
header
template that is applied to allsingle-cpt
files. Withis_single()
it can be put in an even more genericheader
template.For a complete list of labels, see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments