Support

Account

Home Forums General Issues acf if query problem Reply To: acf if query problem

  • I missed some “s in my code, typed it here and there’s not syntax checking. It should have been

    
    $colors = get_field('name_of_color_field_here');
    if ($colors) {
      foreach ($colors as $color) {
        ?><div style="background-color: <?php
              echo $color['value']; ?>" title="<?php 
              echo $color['label']; ?>"></div><?php 
      }
    }