1

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)

0

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 type songs.

  • 1
    Please add an explanation to your answer: why could that solve the problem? – fuxia Dec 12 '13 at 2:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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