Query Post by Custom Date Field
-
Hello,
I can’t figure out why it does not sort correctly on my custom date field.
The Field Group slug = field_group_1
The Field slug = wedstrijd_datumAnd this is my code.
query_posts( array( 'showposts' => 50, 'post_parent' => $this_page_id, 'posts_per_page' => 50, 'post_type' => 'page', 'meta-key' => 'wedstrijd_datum', 'orderby' => 'meta-key', 'order' => 'ASC' ) ); while (have_posts()) { the_post();
In my code I get the date with this php script:
$selected_value = simple_fields_get_post_value(get_the_id(), "Datum", true);
I also changed this:
'orderby' => 'meta-key' into 'orderby' => 'wedstrijd_datum' or 'orderby' => 'Datum'
But no succes yet ??
Hope someone can help me out.
Thanks,
Bjorn
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Query Post by Custom Date Field’ is closed to new replies.