Title: &#8216;if&#8217; function not working
Last modified: September 23, 2020

---

# ‘if’ function not working

 *  [StickyPixels](https://wordpress.org/support/users/stickypixels/)
 * (@stickypixels)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/if-function-not-working/)
 * I’m trying to use the default <?php if ( get_field(‘field_name’) ): ?> function
   to check if the field has a value, but it is ignored on the archive page.
    Without
   it the field displays correctly, but as soon as I wrap it with ‘if/else’ the 
   field is ignored.
 * Am I missing something or is this a bug?

The topic ‘‘if’ function not working’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/acf-archive.svg)
 * [Advanced Custom Fields: Archive Templates](https://wordpress.org/plugins/acf-archive/)
 * [Support Threads](https://wordpress.org/support/plugin/acf-archive/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-archive/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-archive/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-archive/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [StickyPixels](https://wordpress.org/support/users/stickypixels/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/if-function-not-working/)
 * Status: not resolved