From Dan, 10 Years ago, written in Plain Text.
Embed
  1. while ($sunday_query->have_posts()) : $sunday_query->the_post();
  2.        
  3.         $sort_array = array();
  4.         $schedules = get_post_meta($post->ID, 'show_sched', false);
  5.         $title = get_the_title();
  6.  
  7.         foreach($schedules as $schedule):
  8.  
  9.                 $theday = $schedule[0]['day'];
  10.                 $theorder = $schedule[0]['start_hour'];
  11.  
  12.                 foreach($schedule as $key => $value):
  13.  
  14.                         $sort_array[$theorder] = $schedule;
  15.  
  16.                 endforeach;
  17.  
  18.     endforeach;
  19.  
  20.         ksort($sort_array, SORT_NUMERIC);
  21.  
  22.         foreach($sort_array as $sort) {
  23.                 foreach($sort as $key => $value) {
  24.                         $day = $value['day'];
  25.                         $order = $value['start_hour'];
  26.                         if($day == 'Sunday') {
  27.                                 echo $day.', '.$order.', '.$title;
  28.                                 echo '<br>';
  29.                         }
  30.                 }
  31.         }
  32.  
  33. endwhile;

Replies to sort custom posts by custom meta value data rss

Title Name Language When
Re: sort custom posts by custom meta value data Wet Lizard text 10 Years ago.
Re: sort custom posts by custom meta value data Dan text 10 Years ago.