I found the following solution:
SELECT wposts . *
FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
WHERE wposts.ID = wpostmeta.post_id
AND wpostmeta.meta_key = 'datum'
AND wposts.post_type="optredens"
AND wposts.post_status="publish"
ORDER BY wpostmeta.meta_value ASC
As other query_posts()
methods / alternatives did not work very well.
Related Posts:
- Date, Time, and Timezones
- Order by custom field date?
- Order by custom field date with ASC order
- Ordering posts by anniversary using only day and month
- Localized Date Format for Custom Field
- How can I query on the year part of a complete date in a custom field?
- Displaying posts with only upcoming dates according their custom field date value
- Ordering posts by custom field named “date” in backend
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- Convert all dates stored in custom field
- How show post only from after custom date
- How to query posts by month based on date custom field?
- Group Posts By Custom Meta Value: Date
- WordPress Admin – Automatically Sort Custom Posts by Custom Field Date Value in d-m-Y Fomat
- Thirtieth century date for a post
- Order a query by meta_value and then by post_date
- WordPress archives by custom field and date
- Complex WP_Query Using Post Date And Post Meta
- Checking if field is set before comparing with meta_query in query_posts?
- Display posts where date field matches current month?
- Dynamically update Custom Fields to display new dates
- Importing data for advanced custom fields plugin?
- Gutenberg add a custom metabox to default blocks
- How to rename a custom field?
- Filter post listing by meta value which is a date
- Extra profile field as select box?
- Matching Serialized Arrays with meta_query
- Pre-filling custom fields on New Post
- Make Custom Field Into A Link On The Front End?
- How to activate “custom fields” section in WP3
- Why isn’t my code to save custom fields in quick edit working?
- How to oEmbed from custom field, responsive to container size and responsive
- Custom Meta Boxes: Store two values in one repeatable field
- Copy SEO Meta Desc “Custom Field” to Excerpt field?
- Custom fields won’t display on my blog page
- How to customize default wordpress editor?
- Add an advert every nth Paragraph
- How to edit multiple post with Custom fields
- Undefined index error when saving content on metabox
- Metabox with multiple fields added by user and upload box
- How to update custom user meta field in wp?
- Get all meta keys assigned to a post type
- sort search results by custom fields using dropdown
- Add conditional custom option to ‘Display name publicly as’ dropdown
- Custom fields not getting saved in the databse when added to the add new user profile page
- I want to send an email when each post is published
- Creating a widget with a number of custom fields
- Show 1 post and after a specific date show the next one
- How to Create Dynamic Fields in a Meta Box?
- Set front page option using custom fields?
- Add post meta fields, when creating a post using WordPress’ REST API
- Custom Field Values not updating unless I click “Update” twice
- Can I create a template or doctype for my blog site?
- Custom field, add class to anchor tag
- Custom Metabox additional item
- How to combine custom fields to make one order-able value
- Updating Other User’s Metadata
- get_posts in meta box dropdown not showing latest posts
- Trying to reorder posts by custom field
- Custom Query based on custom field of a single post
- comment meta_query for keys that aren’t yet set
- Link the retrieved custom field values to its respective posts
- Sortable custom field values from all posts on a page template
- How can I use custom properties to set different background on different pages?
- Values entered in a meta box aren’t saved
- change order of images attached to post
- How to Make Post Custom Column Editable
- tax query between operator like
- Single page WordPress website – custom fields or meta boxes or something else?
- Collect Data from NEXT item while in loop
- Order custom fields alphabetically
- Is it possible to compare the current time with a custom “start” and “end date
- Redirect DRAFT Posts to a Custom URL (Custom Field) : Currently 404 Page
- multiple meta_query and orderby question
- Problem with my loops
- How to make menu country specific?
- SQL query to change the value of a Custom Field
- Adding more fields to the registration form
- want to add video upload option for front end user
- Adding fields to attachment – only shows when inserting new attachments
- How can I set and update the the_date according to a custom field of the post
- How do I use foreach to get content from a custom-field in multiple posts?
- Is it possible in WordPress
- Related post thumbnail not showing up
- Edit different parts of a page seperately
- Copy url from post_content to custom field
- I want my post to republish again after adding a custom field
- Custom fields: dropdown values depending on other custom field value
- How do i get a specific user metadata using custom metavalue outside of wordpress?
- Creating an If/Else statement using WPAlchemy MetaBox radio boxs
- How to retrive Custom Fields as Values for a Form field
- Custom fields doesnt work well with any postTAB plugin
- Colecting values from custom field checkboxes and displaying them in the post
- Build Array from Input Fields question
- Grouped Custom Meta Fields without plugin
- Google not index my Custom 404 page ?why?
- Add CSS class to posts with certain meta key
- WP_Query sort by ACF date field (newest first) with blank dates first
- Best way for managing images of ads banners
- Crop custom image size vs actual size