[wp-testers] is_post_type not working correctly

Andrew Nacin wp at andrewnacin.com
Fri Jun 4 17:24:50 UTC 2010


On Fri, Jun 4, 2010 at 1:11 PM, Michael E. Hancock
<justmichaelh at gmail.com>wrote:

>
> From: <hedwig at senzafineonline.net>
>
>> I tried with is_singular() but it didn't work.
>
>
>
>  Now I see what scribu wanted with is_post_of_type in
> https://core.trac.wordpress.org/ticket/12588 but I don't think that made
> it into core.
>
> Try
>
> if ( 'video' == $post->post_type  )


For the post's current type, try get_post_type(). It's also been around
since 2.1.


More information about the wp-testers mailing list