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?
- Using meta query (‘meta_query’) with a search query (‘s’)
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- Sorting: custom query with orderby meta_value_num THEN by title
- Filter WP_Query for posts having a certain meta-value
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- 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
- Sorting posts by custom date fields (non standard date format)
- Sort posts by custom field numeric value using dropdown
- Filtering a WP_Query meta_query by numeric values isn’t working
- Getting attachments by meta value
- How do I search an array stored in a custom-field using WP_Query?
- querying with custom meta field with meta_query
- How do I order by multiple custom fields using wp_query?
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Query meta field using between
- 2 orderby in wp_query with 2 custom fields
- Can serialized arrays in DB be matched against serialized arrays with meta_query?
- Order by custom field date with ASC order
- Order posts by date and then by custom field
- How to get a meta value from all post
- How to order a post type with meta_value_num and if meta_value_num does not exist then order by date
- WordPress Search Custom Meta Field Only
- Revolution Slider Orderby Two Custom Fields
- Order Custom post type loop by custom field (datepicker)
- Sorting within nested queries / multiple meta keys
- WordPress altering my custom query, How to fix it?
- Calling Specific Pages with wp query Part II
- Order by Custom Field date not recognized
- Comments form custom fields order
- WP_Query multiple use of relation and/or
- If value present, order posts by two consecutive custom fields
- Loop through two different sets of custom fields
- Query Problem – Show posts within category ‘x’ that have a custom field between ‘y’ and ‘z’
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- 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
- Order by meta_key in custom post type doesn’t affect the query
- How can I query on the year part of a complete date in a custom field?
- WP_query : meta_key with custom rule for specific value
- Displaying posts with only upcoming dates according their custom field date value
- How to filter a dd/mm/yyyy date from a custom field in a query
- 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
- Display custom post types with custom date field value (before today) & order by custom date field
- Compare WP Custom Field date
- meta_value_num sort glitch
- Sort by posts that have a featured image?
- Order by value in serialized custom field
- Meta query with order by another custom field
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- WP_Meta_Query causing long-running MySQL queries
- $wp_query meta_key naming issue [closed]
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- Meta_query and numeric comparison [closed]
- Filtering by Post Meta Custom Fields – Performance
- meta_query for a string inside a meta field containing a comma-separated list
- Order by custom field value not working for acf date field
- Adding Custom Fields to Search
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- Any way to include custom fields in WP_Query results?
- Complex Orderby Parameters: How to query with multiple orderby parameters using meta_value_num?
- pre_get_posts order by not working
- Complex WP_User_Query call fails on production server
- Multiple relationships in a query
- WP Query Returning All Posts
- How do I use wp_query for WordPress search?