Home › Forums › General Issues › Hiding Empty/Unhiding non-empty Fields not working › Reply To: Hiding Empty/Unhiding non-empty Fields not working
I placed the above code in a template file and it broke the template. The data is coming from a field added to a user’s profile. While editing the profile on user-edit.php, I can see that the data has successfully saved.
The problem is that the hide/unhide code referenced in my original post doesn’t really pull and unhide the data and its label.
<?php if( get_field('street_address_address') ): ?> <p>My real address: <?php the_field('street_address_address'); ?></p> <?php endif; ?>
The code above shows how I’ve coded my template. If it were to work, it should say:
My real address: 4027 e. kyle
But instead nothing shows. Here is the actual page:
The label and data should show up under the photo/ID #.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
The ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 21, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.