Home › Forums › General Issues › sort custom posts by time from repeater › Reply To: sort custom posts by time from repeater
thanks for fast reply… is it possible to sort my custom post type with the date-time-picker?
for example… to get all Courses from monday i use the following… but it is not sorted by time…
<?php
// args
$args = array(
'post_type' => 'kurse',
'posts_per_page' => -1,
'meta_query' => array(
array(
'meta_key' => 'von',
'orderby' => 'meta_value_num',
'order' => 'ASC'
)
)
);
// query
$wp_query = new WP_Query( $args );
// loop
while( $wp_query->have_posts() )
{
$wp_query->the_post(); ?>
<?php $tag_wahl = get_field('tag'); if($tag_wahl == 'Montag'): ?>
<?php the_title(); ?><br>
<?php if(get_field('zeit')): ?>
<?php while(the_repeater_field('zeit')): ?><?php the_field('tag'); ?>´s von <?php the_sub_field('von'); ?> Uhr bis <?php the_sub_field('bis'); ?> Uhr.
<?php endwhile; ?><br><br>
<?php endif; ?>
<?php endif; ?>
<?php }
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.