Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $postOrdered = array();
- $queryPosts = new WP_Query(array(
- 'posts_per_page' => -1,
- 'post__in' => $postIds,
- 'orderby' => 'usp-custom-80', // this tells WP Query to sort by distance
- 'order' => 'DESC',
- 'orderby' => 'date',
- 'meta_key' => 'usp-custom-80',
- 'type' => 'DATE',
- )
- );
- if( $queryPosts->have_posts() ):
- while ( $queryPosts->have_posts() ) : $queryPosts->the_post();
- array_push($postOrdered, $post->ID);
- $date = usp_get_meta(false, 'usp-custom-80');
- echo $date."<br>";
- endwhile;
- endif;
- 2-6-2015
- 21-12-2018
- 26-12-2018
- 18-12-2018
- 27-12-2018
- 12-11-2018
- 21-12-2018
- 7-12-2018
- 5-12-2018
- 5-12-2018
- 6-12-2018
- 19-12-2018
- 7-12-2018
- 13-12-2018
- 24-11-2000
- 25-11-2018
- 13-11-2018
- $postOrdered = array();
- $date = usp_get_meta(false, 'usp-custom-80');
- $date = DateTime::createFromFormat("d.m.Y", $date)->format("m/d/Y");
- $queryPosts = new WP_Query(array(
- 'posts_per_page' => -1,
- 'post__in' => $postIds,
- 'orderby' => 'usp-custom-80', // this tells WP Query to sort by distance
- 'order' => 'DESC',
- 'orderby' => $date,
- 'meta_key' => 'usp-custom-80',
- 'type' => 'DATE',
- )
- );
- if( $queryPosts->have_posts() ):
- while ( $queryPosts->have_posts() ) : $queryPosts->the_post();
- array_push($postOrdered, $post->ID);
- $dateOrdered = usp_get_meta(false, 'usp-custom-80');
- echo $dateOrdered."<br>";
- endwhile;
- endif;
Add Comment
Please, Sign In to add comment