Title: Conditional Fields
Last modified: August 22, 2016

---

# Conditional Fields

 *  [justplaindoug](https://wordpress.org/support/users/justplaindoug/)
 * (@justplaindoug)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/conditional-fields-5/)
 * I am kind of a noob, and trying to figure out how to make fields only show up
   if completed. Meaning, I’ve got a label and then the <?php the_field(”); ?> set
   up, but I want to write a conditional statement that encompasses the entire area
   so I don’t even show the label if the field is empty.
 * Any assistance is greatly appreciated

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/conditional-fields-5/#post-5328069)
 * Function the_field() is not a part of standard WordPress, so I am not sure what
   is providing it. If it comes from the Advanced Custom Fields plugin, your code
   would look similar to this:
 *     ```
       <?php if ( get_field('field_name') ) {
          // code here for label
          the_field('field_name');
       ?>
       ```
   
 *  Thread Starter [justplaindoug](https://wordpress.org/support/users/justplaindoug/)
 * (@justplaindoug)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/conditional-fields-5/#post-5328076)
 * kinda broke the page. Here is the code I currently use to output the email field
 * (i use “Types” plugin btw)
 * `<a href="mailto:<?php $email = types_render_field("email", array("raw"=>"true","
   separator"=>";")); echo $email; ?>" class="contact_link">Email</a>`
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/conditional-fields-5/#post-5328077)
 * Sorry, I don’t use that plugin. You might have better luck posting in the Types
   support forum: [https://wordpress.org/support/plugin/types](https://wordpress.org/support/plugin/types)

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

The topic ‘Conditional Fields’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/conditional-fields-5/#post-5328077)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
