Support

Account

Home Forums Add-ons Repeater Field Have rows condition sub_field same value

Unread

Have rows condition sub_field same value

  • Hello,

    I wan’t to determinate if the sub_field [‘current_value’] of row[‘dates’] have same value loop into this and get the first row and the last row to have start and end date.

    it is the screenshot here of my back-end.

    http://i.imgur.com/sE5ujlS.png

    	$the_query['post_type'] 		= 'events';
    	$the_query['posts_per_page'] 	= -1; 
    	// $the_query['meta_key'] = 'current_value';
    	// $the_query['orderby'] = 'meta_value';
    
    	$i=0;
    
    query_posts($the_query);
    	if (have_posts()) : while (have_posts()) : the_post();	
    
    	$values = get_field('dates');
    	if($values){
    
    $i = 0;
    
    $date_start[$i] = array();
    $current_value[$i] = array();
    
    $i = 0;
    
    	foreach($values[$i] as $value)
    	{
    		 array_push($date_start,$value['date']); 
    		array_push($current_value,$value['current_value']);
    	}
    
    }
    	endwhile;
    	endif;

    Thank you

Viewing 1 post (of 1 total)

The topic ‘Have rows condition sub_field same value’ is closed to new replies.