So I have a search results page I’m working on.
I have a number of custom post types that I’d like to differentiate in the list of results from regular blog posts.
What I tried to do was something like this:
if( is_singular( 'post' ) ) :
// show meta data for things like date, author and taxonomy
else :
// show something like "custom post type name"
endif;
The idea here is that is_singular( 'post' )
returns true if it’s a standard post, and returns false if it’s a custom post type.
The problem I’m experiencing is that it is always returning false, even for my regular, old blog posts.
What am I doing wrong or completely misunderstanding?2
Thanks!