[wp-testers] is_post_type not working correctly

Andrew Nacin wp at andrewnacin.com
Fri Jun 4 14:48:04 UTC 2010


On Fri, Jun 4, 2010 at 10:37 AM, hedwig at senzafineonline.net <
hedwig at senzafineonline.net> wrote:

> I spend a lot in the last weeks setting up my custom post types and
> taxonomies and making my site work flawlessly with them but after upgrading
> to RC1 I noticed everywhere in my theme where I used is_post_type to
> determine what post type was being used to display different content wasn't
> working so it would display all the content regardless of post type.


is_post_type() tells you whether the post type is registered. Use
is_singular(), which now takes an optional argument of the post type you
wish to confirm.


More information about the wp-testers mailing list