Reputation: 11
I have a site with a form created with gravity forms. The visitor fills out this form and it populates a custom post type. The fields that the user completes are custom fields that I have created with the plugin "Advanced custom fields".
The form has a series of questions that the user fills out, but will leave some blank, as they are not all required.
This is the code used for the output:
I need to figure out how to hide the text 'Birthday' if the birthday field is left blank.
Upvotes: 1
Views: 833
Reputation: 21
You should be able to do this:
<?php
if( get_field( "birthday" ) ) {
the_field( "birthday" );
}
?>
Source: http://www.advancedcustomfields.com/resources/functions/the_field/
Upvotes: 1