If you use is_singular()
, you’re also checking for if it’s a singular item on the page. Do $post->post_type == 'my-post-type'
instead.
BTW: if you use post_class()
you get this and more done automatically.
If you use is_singular()
, you’re also checking for if it’s a singular item on the page. Do $post->post_type == 'my-post-type'
instead.
BTW: if you use post_class()
you get this and more done automatically.