Skip to main content
3 of 3
edited tags
kaiser
  • 50.8k
  • 27
  • 150
  • 244

Added if statement to loop

I'm trying to add a feature to my loop.php to use with a custom post type. However, I don't want it displayed on all posts, just the ones that are the custom post type (let's say its called "review").

Is there a way to say if post type = review then show this new section, otherwise hide?

I tried using

<?php if( get_post_type() == 'reviews' ) 

but I don't know how to phrase the else statement to just do nothing and continue on normally.

Thank you!

hiiambo
  • 71
  • 1
  • 3
  • 11