Return to Snippet

Revision: 59848
at October 4, 2012 20:43 by i-am-andy


Initial Code
<?php

if ( is_singular( 'testimonial' ) ) {

	/* Run some code if viewing a singular testimonial. */
}

?>

Initial URL
http://justintadlock.com/archives/2011/07/20/conditional-checks-for-custom-post-types

Initial Description
Suppose you wanted to check if a user was viewing a singular post with the post type of testimonial. You can use the next code sample to perform this check.

Initial Title
Wordpress Conditional statement for Singular Custom Post Type

Initial Tags
wordpress

Initial Language
PHP