Support

Account

Home Forums Front-end Issues Order loop by timepicker subfield

Unread

Order loop by timepicker subfield

  • I can’t seem to figure out how to order the posts by subfield (time).

    Here is my loop. The timepicker subfield is cours_temps_heure and the repeater field is cours_loop.

    Can anybody help me out please.

    $args = array(
    	'post_type'	=> 'cours-de-groupe',
    	'numberposts' => -1,
    	'ignore_sticky_posts' => true,
        'order' => 'ASC'
    );
    $loop = new WP_Query( $args );
    				
    while ( $loop->have_posts() ) : $loop->the_post();
    
    	if(have_rows('cours_loop')) :	
    		while(have_rows('cours_loop')) : the_row();
    		
    		$count = 2;
    		$day = get_sub_field('cours_jour');
    		$timeStart = get_sub_field('cours_temps_debut');
    		$timeEnd = get_sub_field('cours_temps_fin');
    		$coursTitle = get_the_title();
    		
    		$coursBlock = '<div class="'. $day .' clmn">'. $coursTitle . $timeStart .'</div>';
    			
    		
    
    				echo $coursBlock;
    		
    		endwhile;
    	endif;
    	
    endwhile;
Viewing 1 post (of 1 total)

The topic ‘Order loop by timepicker subfield’ is closed to new replies.