If the value of your custom fields is numeric, you could try ordering with meta_value_num. Also note that both meta_value and meta_value_num require meta_key in the query as described here.
$args = array(
'post_type' => 'post',
'posts_per_page' => $number,
'meta_query' => array(
'relation' => 'OR',
array(
'meta_key' => 'event-start',
'value' => $today_is,
'type' => 'NUMERIC',
'compare' => '>='
),
array(
'meta_key' => 'event-end',
'value' => $today_is,
'type' => 'NUMERIC',
'compare' => '>='
)
),
'orderby' => 'meta_value_num',
'order' => 'ASC',
);
Related Posts:
- WP_Query – Order results by meta value
- ORDER BY custom field value
- Can I query custom meta data through WP_Query
- Meta Query with AND & OR?
- Order Posts by Closest Numeric Values
- Is there a way to do multiple ordering on a multiple meta_query?
- Compare meta_query decimals not working right
- Ordering posts by anniversary using only day and month
- Using OR in WP_Query negates the “NOT EXISTS” compare
- How can I combine meta_query queries?
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- Sorting posts by multiple values, combined
- WP_Query display next custom post from today’s date
- Order Posts by meta value AND published date
- Sorting posts by custom fields in meta_query
- Meta query with timestamp using WP_query
- Alter main archive, to show posts with meta as last
- meta_value_num not ordering all items
- Change order of posts
- Meta Query And/Or
- Meta query with multiple custom fields for archives page ordering problem
- Ordering posts by custom field named “date” in backend
- WP Query – Is this correct?
- ORDER BY custom field value out of where clause
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- How can I modify my meta_query to work with prices that are stored in the database that contain dollar signs and commas?
- Sorting: custom query with orderby meta_value_num THEN by title
- Matching Serialized Arrays with meta_query
- WP_Query orderby custom field then post_date in one query
- Custom WP_Query order by post_meta and (author) user_meta
- Filtering a WP_Query meta_query by numeric values isn’t working
- How do I order by multiple custom fields using wp_query?
- Query meta field using between
- Can serialized arrays in DB be matched against serialized arrays with meta_query?
- Order posts by date and then by custom field
- Comments form custom fields order
- WP_Query multiple use of relation and/or
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- query order by date on custom type: wrong order
- Slow meta query with multi meta keys
- meta_key and meta_value not working together
- Using WP Query to search by multiple meta fields
- Order WP Query posts by custom order calculated from post meta values
- Compare WP Custom Field date
- Sort by posts that have a featured image?
- WP_Meta_Query causing long-running MySQL queries
- $wp_query meta_key naming issue [closed]
- Meta_query and numeric comparison [closed]
- Filtering by Post Meta Custom Fields – Performance
- Any way to include custom fields in WP_Query results?
- Multiple relationships in a query
- WP Query Returning All Posts
- Returning a list of custom post types excluding those without a specific meta_value
- How to make Meta Query case sensitive?
- Auto Populate Custom Field with Complex Value That Increase by One?
- WP_Query orderby not working with meta_value_num and menu_order
- How to add a new meta key and assign timestamp to posts
- Get content from pages with same meta_key from Database
- Meta_query with multiple keys and multiple values
- meta_query BETWEEN, but the range is stored in the custom field
- Order RSS content by an advanced custom field value
- How to do WP_Query with two meta fields with orderby clause
- Understanding the orderby in WP_Query?
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Order ascending is ignored in meta query?
- Trying to sort and display categories(not posts) by custom field: ‘order’
- Use meta_query to get title of associated post
- get posts where a custom field contains a text
- meta_value and meta_key filtering returning no posts [closed]
- Adding custom field and querying from post table
- Sortable Custom Columns not sorting correct
- Meta_query ‘compare’ => ‘LIKE’ not working?
- WP_query multiple custom fields not working
- Ordering by ‘Title’ OR ‘Custom Field’
- Multiple Custom Field Query
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- meta_query weird behaviour, static int will work, but not user data
- Making WP_Query limit results by date before today where date is a meta_query
- multiple meta_query and orderby question
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- Trouble with serialized metadata
- Meta query orderby meta_value_num sorting by role first
- Sort custom post archives by a meta value from a different custom post type?
- Why does my numeric meta query work only on one meta key and not the other?
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- meta_query to check all custom fields
- Custom post types – meta_query: search lesson which starts sooner
- WP_Query sort by meta_value_num or date
- Selecting posts older than the current Unix epoch timestamp
- $args Orderby The number
- query_posts with sorting on a custom datestamp
- Query Posts Via WordPress URL
- How to Order Posts by Custom Fields?
- Meta_query not filtering posts
- WP_Query with several meta_query-statements and order by meta_value
- Complex WP_Query Using Post Date And Post Meta
- Querying meta values within an array
- Dynamic background image used in css after selector
- WP Query Args – search by meta_key or title
- WP_Query sort by ACF date field (newest first) with blank dates first