tags:

views:

13

answers:

1

Hi, I am using the custom post types in my wordpress blog and want to have a different icon for each type of post.

<?php if ( is_post_type( 'team' ) ) {
    echo '<img src="team.png" />';}
else
{
    echo '<img src="page.png" />';
}?>

But I get following error message: Fatal error: Call to undefined function is_post_type().

Any suggestions?

A: 

What version of WP are you using? Looks like is_post_type() was deprecated...

http://core.trac.wordpress.org/ticket/13747

You should probably use get_post_type() instead:

http://codex.wordpress.org/Function_Reference/get_post_type

W_P
Yes, works! Thanks for your help.. Sure you wrote post_type_exists before… that didnt work :D
Matthew Pateman
ya, my bad. but at least i was right eventually :p
W_P