Support

Account

Home Forums Add-ons Repeater Field Using repeater for look up not working Reply To: Using repeater for look up not working

  • You are almost there, if you’re going to loop through the same repeater again then you should probable reset the rows as well. Or you may be able to break out of the loop if you reset the rows. You could try something like this.

    
    function get_column_content($columnId){
        if (have_rows("adv_columns",get_the_ID())){
    	while(have_rows("adv_columns",get_the_ID())){
    	   the_row();
    	   if(get_sub_field('column_id')==$columnId){
    	      $found= get_sub_field('content');
                  break; // found it, don't continue looking
    	   }
    	}
            reset_rows();
        } // end if have rows
    	return $found;
    }