Support

Account

Home Forums General Issues How to put php codes in a loop

Helping

How to put php codes in a loop

  • Hello, I have this code:

    <?php 
    
    $colors = get_field('lunes');
    
    if( $colors && in_array('a', $colors) ) {
      $color ="#ddebf7";} ?>

    The problem is that it doesn’t work for me inside a loop, I don’t know if I have to modify it with
    “foreach” or something similar.
    Thank you

  • It is not clear to me what you are trying to achieve. Can you explain more.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.