Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Please help with this code for custom post type "video":

If is single-video.php page {

     list custom-taxonomy of video. Example actors

} Else { do nothing }

I´m tried with is_single, is_singular, is_page_template but imposible.

share|improve this question

1 Answer 1

According to the WordPress conditional docs it should be:

if(is_singular( 'video' ) ){
     // do conditional stuff

}
else{
     //do other stuff
}

Also if you want a blank page or no content to show when the CPT is not video you don't really need the else so you could omit it. You could ALSO do something like:

if(!is_singular( 'video' ) ){
     // do nothing

}
else {
     //do conditional stuff
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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