PHP if this OR that
Posted: Fri Feb 25, 2011 3:32 pm
I'm very new to PHP and am trying to write a code snippet for a Wordpress website.
The current (working) PHP code is the following...
I need to change it so that the code so the image shows if EITHER the 'audio' or 'video_embed' fields are present. Here is my (nonworking) attempt...
Do you see what I did wrong?
Or is there a better way to write this?
Thanks so much
The current (working) PHP code is the following...
Code: Select all
<?php if(get_post_meta($post->ID, 'audio', true)): ?><img src="http://www.website.com/images/home/icon.gif" alt="" border="0"><?php endif; ?>Code: Select all
<?php if(get_post_meta($post->ID, 'audio', true) || ($post->ID, 'video_embed', true)): ?><img src="http://www.website.com/images/home/icon.gif" alt="" border="0"><?php endif; ?>
Or is there a better way to write this?
Thanks so much