Title: [Plugin: Custom Content Type Manager] Conditional statement
Last modified: August 20, 2016

---

# [Plugin: Custom Content Type Manager] Conditional statement

 *  Resolved [loiclejour](https://wordpress.org/support/users/ataxel/)
 * (@ataxel)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-conditional-statement/)
 * I there, I really enjoy to get to know your plugin. I can now built more personal
   website and that is so great.
 * As for now, i’m working on template and have some questions. For the moment, 
   i’ll only ask about not displaying an empty custom field. I mean if the custom
   field is empty, i won’t print any label either.
 * As for my small knowledge, it works with :
 * `
    <?php if($custom_field_name !== '') { ?> LABEL: <?php echo $custom_field_name;?
   > <?php } ?
 * Can you help me manage this part please.
    By the way, i read the 7 pages of topics
   here to find solution…
 * Namaste, Lp(*
 * [http://wordpress.org/extend/plugins/custom-content-type-manager/](http://wordpress.org/extend/plugins/custom-content-type-manager/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [416BC](https://wordpress.org/support/users/416bc/)
 * (@416bc)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-conditional-statement/#post-2812619)
 * This works for me.
 *     ```
       <?php
       $city = get_custom_field('location_city');
   
       if ($city !== ''): ?>
       	<strong>Location: City</strong> <?php echo $city; ?>
       <?php endif ?>
       ```
   
 *  [416BC](https://wordpress.org/support/users/416bc/)
 * (@416bc)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-conditional-statement/#post-2812621)
 * Here is a bit shorter and cleaner.
 *     ```
       <?php
       if ((get_custom_field('location_city')) !== ''): ?>
            <strong>Location: City</strong> <?php print_custom_field('location_city'); ?><br />
       <?php endif ?>
       ```
   
 *  Thread Starter [loiclejour](https://wordpress.org/support/users/ataxel/)
 * (@ataxel)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-conditional-statement/#post-2812703)
 * Thank you, it’s really appreciate!
 *  [416BC](https://wordpress.org/support/users/416bc/)
 * (@416bc)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-conditional-statement/#post-2812706)
 * Glad I could help.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Custom Content Type Manager] Conditional statement’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-type-manager_c9c790.
   svg)
 * [Custom Content Type Manager](https://wordpress.org/plugins/custom-content-type-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-content-type-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-type-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-type-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-type-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-type-manager/reviews/)

## Tags

 * [condition](https://wordpress.org/support/topic-tag/condition/)

 * 4 replies
 * 2 participants
 * Last reply from: [416BC](https://wordpress.org/support/users/416bc/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-conditional-statement/#post-2812706)
 * Status: resolved