You have a typo in orderby
, and meta_value_num
is only used as an orderby
value, try this:
$args = array(
'post_type' => 'event',
'tax_query' => array(
array(
'taxonomy' => 'locations',
'field' => 'id',
'terms' => $location // location term id
)
),
'meta_key' => 'event_date', // this meta field stores event date in yymmdd format
'meta_value' => $today, // this would be today's date in yymmdd format
'meta_compare' => '>=',
'posts_per_page' => $numberofposts, // this variable stores the number of posts I want to get
'orderby'=> 'meta_value_num'
);
Related Posts:
- Print terms with taxonomy and metabox value
- Sorting main query by custom taxonomy slug
- WP REST API – get custom taxonomies based on terms & filter
- WordPress search form and search result through ACF field in custom taxonomy
- Is ACF being a honey trap? [closed]
- Add custom taxonomy fields when creating a new taxonomy
- Display category posts grouped by taxonomy
- How to modify the query in taxonomy-custom.php to sort term archives by a custom meta field?
- register_rest_field for custom taxonomy fields that are assosiated with custom post type
- Filter all queries with a specific taxonomy
- Is it possible to sort the post based on a custom field?
- wp_query orderby title and meta key value (WP3.1)
- Custom taxonomy – custom sortable column
- Help With issue on pre_get_posts filter in taxonomy
- How to display submenus on page based on referring top-level parent?
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- how to create a proper query for getting a list of users with taxonomy related meta key
- How to add custom field to custom taxonomy in 4.4
- How to List Parent Term Links for Custom Taxonomy With & Without Children?
- how to search in custom fields & custom taxonomy for custom search
- Getting yoast title for custom taxonomy
- Outputting an array of term meta values in a custom WooCommerce tab?
- List the number of posts for each custom taxonomy and specific custom field value
- Solve product properties with custom taxonomies?
- Is it acceptable to build functionality into a theme built for a client? [closed]
- Recreating the hierarchy of taxonomies for a dropdown form menu?
- Meta query for a custom taxonomy on attachment
- How to implement custom search with input fields?
- Can I use a Custom Meta Value inside of ‘get_the_terms’?
- How to add contents of a custom field to a taxonomy term list?
- How can I hide admin columns showing extra custom taxonomy fields?
- Conditional display for custom fields/taxonomy
- How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?
- What is faster: custom taxonomy or serialized post-meta for db retrieval? (over 60,000 posts)
- I am trying to display information from a custom table from my wordpress users pages
- Checkbox onclick filtering on the same page
- Save custom taxonomy data in different table not in wp_options for my own plugin
- How to create a dependent drop-down and options in dropdown must be manageable from admin panel
- How to separate posts in loop?
- Alter main archive, to show posts with meta as last
- First custom field value (out of several) displayed twice after query
- Search Tool only refreshes Page without showing results
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- How do I display a custom field from a custom taxonomy in single.php?
- Passing form inputs into multi-taxonomy query
- WordPress implode & wp_insert_post question
- Best structure for entering recipes in a WordPress theme?
- Exclude taxonomy term from all loops, but having it on widget
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- Copy/clone/associate Custom field to Custom Taxonomy
- saving meta/custom field to tag
- How to support fifteen thousand terms in WordPress?
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Different Taxonomy Values for Each Post
- What’s the best way to add taxonomy’s image in 2017?
- How to get product order by two custom taxonomy in wordpress
- Get list of taxonomies associated with users
- Why can’t I access Custom Taxonomy metadata?
- how to access the $query variable inside taxonomy-xxx.php template file?
- Query custom taxonomy for category including children
- Update Custom Taxonomy Value for a post based on custom date field
- Get 1st parent category id from post
- Filter by Custom Taxonomy AND Custom Field
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- Taxonomy or Custom Field
- making an index from custom taxonomies and tags of posts (not hierarchical taxonomy)
- Trash Bin for Categories?
- How to use custom slug and custom templates for custom taxonomy?
- Using OR relation in meta_query to check for a value before sorting by another
- Custom field with terms from another taxonomy programmatically
- Fill New Taxonomies
- Convert post meta to custom taxonomy?
- Meta query and compare “!=” not working as expected
- Count tags for current post and save into custom meta field (and update it on post edit)
- Query by multiple custom taxonomies
- Query by meta value (add a dropdown of all values)
- Is it possible to sort the post based on a custom field?
- Reset custom taxonomy meta data after saving
- Fastest and most efficient SQL query to check if UID exists
- How to add meta fields to custom taxonomy add/edit page?
- sort Posts by custom user filed
- Tax Query not working
- Custom taxonomy – query returns an error
- How to perform a search inside a specific taxonomy category
- Register custom taxonomy from a Advenced custom field option page
- Meta_query not filtering posts
- How can I show custom field according to taxonomy?
- add_query_arg to look up page title
- Altering term_id and name via $wpdb class
- Can I use $query->set() (in a pre_get_posts() hook) with a custom taxonomy in WP 3?
- Taxonomy Extra Meta [duplicate]
- How can I query for all values of a custom taxonomies?
- Any way to make custom taxonomy field searchable?
- Advanced WordPress search form based on custom taxonomy and custom meta value
- More than one Hierarchical Taxonomy and SEO
- How much worse is querying custom fields compared to custom taxonomies, quantitatively
- Get Posts ordered by a date custom meta field
- Hook to filter based on form value and insert term
- Complex Taxonomy scheme
- Custom taxonomy with custom meta value is not sorting correctly (query returns the same value for orderby regardless of sort column click)