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
- Retrieve posts by term id custom query
- Is ACF being a honey trap? [closed]
- Add custom taxonomy fields when creating a new taxonomy
- Display category posts grouped by taxonomy
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- How to modify the query in taxonomy-custom.php to sort term archives by a custom meta field?
- Meta Query with AND & OR?
- Get value in custom field with taxonomy [closed]
- restrict_manage_posts not working in 3.3.1
- Get total number of comments from posts in a specific custom taxonomy
- Remove Category description textarea
- Custom metabox for menu administration page?
- Custom Fields and performance
- Get terms of posts with category with sql
- register_rest_field for custom taxonomy fields that are assosiated with custom post type
- search query within custom taxonomy term, post title and meta field
- 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
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- How to display submenus on page based on referring top-level parent?
- 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
- How get custom field from custom taxonomy?
- Automatically assign taxonomy term if custom meta value exists
- How loop through posts based on custom fields
- how to create a proper query for getting a list of users with taxonomy related meta key
- Taxonomy.php issue with search and filters
- 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?
- Storing data into custom taxonomies VS post custom fields (post meta)
- 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?
- Custom taxonomy query not working with switch_to_blog
- Custom fields to taxonomy
- Custom fields ‘for’ custom taxonomy?? Can someone explain why?
- Meta query for a custom taxonomy on attachment
- wp_query check if integer exists in custom field’s array
- Styling Taxonomy Terms Individually
- 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)
- How to show the a custom taxonomy term on single post metadata
- I am trying to display information from a custom table from my wordpress users pages
- Return terms from multiple taxonomies using $wpdb
- 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?
- A way to query custom taxonomies by name
- get the taxonomies terms associated with users
- 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
- Display value of custom field of custom taxonomy in single post?
- Removing “s” from search with custom parameters
- Rewrite Rules returning wrong data
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- WordPress Custom post query sorting does not work
- How do I display a custom field from a custom taxonomy in single.php?
- List related terms + taxonomies
- Multi-select field for Taxonomy can’t save the value
- Passing form inputs into multi-taxonomy query
- Search Query for Multiple Terms In Same Taxonomy
- WordPress implode & wp_insert_post question
- how to store values in database at hierarchical view
- 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
- Custom Query: If One Post Object Field Value Is The Same As Another
- Different Taxonomy Values for Each Post
- Filter through custom taxonomy with an array of taxonomy IDs
- What’s the best way to add taxonomy’s image in 2017?
- Loop through custom taxanomy in post and display custom fields from posts
- How to get product order by two custom taxonomy in wordpress
- Get list of taxonomies associated with users
- query_posts that have custom taxonomy and limiting what shows based on the taxonomy
- Several taxonomy query (like filter)
- Taxonomy archive template that shows posts from more than one taxonomy
- Why can’t I access Custom Taxonomy metadata?