Home › Forums › Front-end Issues › If Statement Not Working › Reply To: If Statement Not Working
As per another thread (https://support.advancedcustomfields.com/forums/topic/the-group-field/) I have also tried the below code, but it doesn’t work either.
/* Add 14 eyes shortcode */
function shortcode_14_eyes() {
$privacy = get_field('privacy');
if( $privacy ):
if( $privacy['fourteen_eyes_country'] ):
return '<span style="color:#EE121E;"><i class="fa fa-exclamation-triangle"></i></span>';
endif;
endif;
}
add_shortcode( '14_eyes', 'shortcode_14_eyes' );
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.