Support

Account

Home Forums General Issues Doesn't show other ACF fields after my code

Unread

Doesn't show other ACF fields after my code

  • Hello, I’m new with ACF and my code is working, kinda.

    Problem: if I put it before other ACF fields they show nothing, but if I put it after, then everything is OK.

    Any suggestion would help 🙂

    <?php
    
    global $quick_flag;
    if(isset($quick_flag) && is_object($quick_flag)){
        if(($info = $quick_flag->get_info()) != false){
            $name = $info->name;
            $flag = $quick_flag->get_flag($info);
        }
    }
    
    $post_objects = get_field('select_your_store');
    
    if( $post_objects ):
    	$post = $post_objects;
    		setup_postdata( $post );
    $selected = get_field('available');
    	if( in_array($name, $selected) ) {
    		echo '<span class="feature-name">' . $flag  . '  ' . $name . ' </span> Accepted';
    	}
    	else {
    		echo '<span class="feature-name"><span class="not-accepted">' . $flag  . '</span> ' . $name . '</span> not accepted';}
      wp_reset_postdata();
      endif;
      ?>
Viewing 1 post (of 1 total)

The topic ‘Doesn't show other ACF fields after my code’ is closed to new replies.