<?php $post_type = get_post_type( $post->ID ); if $post_type == 'project' : echo 'Work'; ?>

How can I make the above work? I want it so that if the post type is ‘projects’, then it echoes ‘Work’.

Also, I want to add another if post type is 'movies' then it echoes 'Film' on top of that.

2 Answers
2

Well, as far as I can tell you’ve got a syntax error there. Try this:

<?php $post_type = get_post_type( $post->ID ); if ($post_type == 'project') echo 'Work'; ?>

Also, make sure to check out what eileen.carpenter said in the comment to your question.

Leave a Reply

Your email address will not be published. Required fields are marked *