Custom Field Schedule
-
I’m trying to create a daily schedule on my site using Custom Fields. I want Custom Fields to display the time (7:00pm), and I want to sort the loop based on time from 12:00am and up to 11:59pm. How can I sort based on my time custom field? I’ve been able to display the content but i can’t figure out how to sort it. This is the code I’m using so far.
<ul> <?php query_posts(array('post_type'=>'page', 'orderby'=>'meta_value_num','order'=>'ASC','post__in' => array(122,124,197,212,113,126,217,111,120,130,118,224,96,116), 'showposts'=>18, 'post_parent'=>93)); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <li class="views-row"> <div class="views-field-phpcode"> <span class="field-content"> <a href="<?php the_permalink(); ?> target="_blank" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a> </span> <span class="field-content"> <?php $customField = get_post_custom_values("Host"); if (isset($customField[0])) { echo $customField[0]; } ?> </span> </div> <div class="views-field-field-event-date-value"> <span class="field-content"> <span class="date-display-single"> <?php $customField = get_post_custom_values("Scheduled Time"); if (isset($customField[0])) { echo $customField[0]; } ?> </span> </span> </div> </li> <?php endwhile; ?> </div> <?php wp_reset_query(); ?> <?php else : ?> sorry nothing here. <?php endif; ?> </ul>
The topic ‘Custom Field Schedule’ is closed to new replies.