I have several custom post types that need to display different values within <title></title>
in the header.
I understand for the home page, posts, categories, and pages you can use..
if (is_home()){ }
elseif (is_category()){}
elseif (is_single() ) {}
elseif (is_page() ) {}
My question is, how would I do the same for individual CPTs (eg. songs, videos, news..etc)
The template tag to check CPTs single page – is_singular. So you can use
is_singular('songs')
to check if the current post page is a single page for post typesongs
.