Timeline for How can I query and sort custom-post type using WP_Query
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 14, 2020 at 11:28 | comment | added | Isakiye Afasha | What if I have a date string inside how do I sort it as a date, not a normal string? | |
May 8, 2020 at 10:22 | vote | accept | Isakiye Afasha | ||
May 8, 2020 at 10:20 | vote | accept | Isakiye Afasha | ||
May 8, 2020 at 10:22 | |||||
May 8, 2020 at 10:20 | comment | added | Isakiye Afasha |
Didn't directly work but you gave me the approach thank you $args = [ 'post_type'=>'game', 'posts_per_page' => 1, 'order' => 'DESC', 'orderby' =>'_game_date_key', 'meta_query' => array( array( 'key'=>'_game_home_goals_key', 'value'=>'', 'compare'=>'!=' ), array( 'key'=>'_game_away_goals_key', 'value'=>'', 'compare'=>'!=' ) ) ]; that's the one I used
|
|
May 8, 2020 at 9:39 | history | answered | yomisimie | CC BY-SA 4.0 |