PHP If / else condition not working for me
-
Hello
I have a simple if/else condition that I just cant seem to get right. I have it half working in that all the pages other than those specified as is_page are displaying correctly ie they call gallery.php and not the image but the pages that are specified as is_page display both the image and gallery.php where they should only be displaying the image. Please help.
Here is my code:
<?php
if (is_page(‘apparel’)) { echo ‘<img src=”https://website/featured/image_apparel.jpg”>’; }
if (is_page(‘automotive’)) { echo ‘<img src=”https://website/featured/image_car.jpg”>’; }
else include (ABSPATH . ‘/wp-content/plugins/featured-content-gallery/gallery.php’); }
?>Thanks.
- The topic ‘PHP If / else condition not working for me’ is closed to new replies.