wordpress snippets last updated   : July 14, 2014
we now have 634 snippets

Check for post type within loop using get_post_type

wordpress snippet

Adding this snippet within the loop of your wordpress theme will let you conditionally check for a specific post type. Just change the post type ‘products’ or ‘people’ to the post type you would like.

snippet :  PHPcopy
if ( 'products' == get_post_type() ){
           ... code to run if products post type...
}elseif ( 'people' == get_post_type()){
           ... code to run if people post type...
           ... code to run if neither of above post types...

jqsnipp.com | we just launched jquery snippets website