If Custom field exist => do that.. If it is not => do something else
-
I have a code that I use
<?php $key = 'video'; $themeta = get_post_meta($post->ID, $key, TRUE); if($themeta != '') { ?> <object type="application/x-shockwave-flash" style="width:150px; height:113px;" data="<?php echo get_post_meta($post->ID, 'video', true); ?>"> <param name="wmode" value="opaque" /><param name="movie" value="<?php echo get_post_meta($post->ID, 'video', true); ?>" /></object> <?php } ?>
So If there is a custom field using video key, it will be displayed. I need to extend this code to display something else when video key is not available. None of my attempts worked well.
Any suggestion is highly appreciated
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘If Custom field exist => do that.. If it is not => do something else’ is closed to new replies.