Skip to main content
edited tags
Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244
added 12 characters in body
Source Link
hiiambo
  • 71
  • 1
  • 3
  • 11

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' )

<?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!

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!

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!

Source Link
hiiambo
  • 71
  • 1
  • 3
  • 11

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!