using Custom Field Suite – need to write an IF statement
-
hi,
I am using Custom Field Suite and my piece of code works fine, it shows a banner and some text on my web pages, I woudl like to write an IF statement around this to say: IF there is no banner or text THEN use default
here is my working code:
<img src="<?php echo $cfs->get('banner_image'); ?>" width="960" height="212" alt="banner3"> <div class="staticbannertext"> <h3><?php echo $cfs->get('banner_text_small'); ?></h3> <span><?php echo $cfs->get('banner_text_big'); ?></span>here is my attempt at the IF statement:
<?php if query_posts('meta_key=banner_feature&meta_value=Yes'); ?> <img src="<?php echo $cfs->get('banner_image'); ?>" width="960" height="212" alt="banner3"> <div class="staticbannertext"> <h3><?php echo $cfs->get('banner_text_small'); ?></h3> <span><?php echo $cfs->get('banner_text_big'); ?></span> <?php else; ?> <img src="../wp-content/themes/corniche/images/banner3.png" width="960" height="212" alt="banner3"> <div class="staticbannertext"> <h3>text</h3> <span>text</span> <?php endif; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘using Custom Field Suite – need to write an IF statement’ is closed to new replies.