Title: If Stament for fields value
Last modified: August 31, 2016

---

# If Stament for fields value

 *  [miguel1876](https://wordpress.org/support/users/miguel1876/)
 * (@miguel1876)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/if-stament-for-fields-value/)
 * Hi guys
 * So I have two options in Post Edit. One to add a Logo and one to add a Title.
   On the front end (in my template) I want to show either the Logo or the Title,
   but not both.
    I added this code however it is not working:
 *     ```
       <?php if( rwmb_meta('restauranttheme_hero_small_logo', false, 'url') !== '' ) { ?>
       			    			<?php $images = rwmb_meta( 'restauranttheme_hero_small_logo', 'type=image_advanced&size=full' );
       					foreach ( $images as $image ) {
           					echo "<img src='{$image['url']}'>"; } ?>
       			    <?php } else { ?>
       				<h1 class="mini-title"><?php echo rwmb_meta('restauranttheme_hero_title' ); ?></h1>
       			<?php }  ?>
   
       I also tried:
       ```
   
 * <?php if( ” != rwmb_meta(‘restauranttheme_hero_small_logo’ ) ) { ?>
    <?php $images
   = rwmb_meta( ‘restauranttheme_hero_small_logo’, ‘type=image_advanced&size=full’);
   foreach ( $images as $image ) { echo “<img src='{$image[‘url’]}’>”; } ?> <?php}
   else { ?> <h1 class=”mini-logo”><?php echo rwmb_meta(‘restauranttheme_hero_title’);?
   ></h1> <?php } ?>
 * I guess the error is in my if else statement.
    Can anyone help?
 * Thanks so much
 * [https://wordpress.org/plugins/meta-box/](https://wordpress.org/plugins/meta-box/)

The topic ‘If Stament for fields value’ is closed to new replies.

 * ![](https://ps.w.org/meta-box/assets/icon-128x128.png?rev=1100915)
 * [Meta Box](https://wordpress.org/plugins/meta-box/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/meta-box/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/meta-box/)
 * [Active Topics](https://wordpress.org/support/plugin/meta-box/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/meta-box/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/meta-box/reviews/)

## Tags

 * [if](https://wordpress.org/support/topic-tag/if/)
 * [option](https://wordpress.org/support/topic-tag/option/)
 * [value](https://wordpress.org/support/topic-tag/value/)

 * 0 replies
 * 1 participant
 * Last reply from: [miguel1876](https://wordpress.org/support/users/miguel1876/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/if-stament-for-fields-value/)
 * Status: not resolved