If/then in single.php for custom post types
-
Hi all,
I have two custom post types, “games” and “activities.” I have different code that I’d like to run for each type. I created both using the Custom Post Type UI plugin.
I already have the code running properly in the games type, but I’d like it not to display on the activities type, and the activities type to have its own code.
I don’t know php very well, I’m trying to come up with an if/then statement to check the post type in single.phpIt would start like..?
<?php if ( 'game' == get_post_type() )
How would it end after the game type’s code? And then on to the activities type’s code?Thanks!
- The topic ‘If/then in single.php for custom post types’ is closed to new replies.