Change
$data = get_post_meta(get_the_ID(),'_event_data',true);
to
$data = get_post_meta(get_the_ID(),'_event_data',false);
As stated in the Code Reference,
Return: (mixed) Will be an array if $single is false. Will be value of meta data field if $single is true.
But somehow I’d just guess that _event_data
doesn’t hold much more than the actual (event-) ID. You’d probably have to make a second get_metadata
function to retrieve all info for the event based on its ID. (see: Code Reference)
Related Posts:
- order by numeric value for meta value
- What is the most efficient way of querying posts based on visits and date for current day?
- Query Custom Meta Value with Increment
- Pull post meta with post_query?
- WordPress query posts with multiple post_meta data
- WP_Query meta compare must include ALL array values
- Query against multiple locations within single custom post type post
- I need query_posts() to order results first by a meta value and then by post ID
- How to get several fields from wp_query?
- How to query post ids liked by the Author
- query by meta value then date and not empty meta value
- Query posts by meta value and sort by another meta key
- How to get posts that have certain meta key value and order based on another meta key’s value
- When should you use WP_Query vs query_posts() vs get_posts()?
- WP_Comment_Query pagination, delving into the unknown
- Sort posts by category name and title
- WP_Query for WooCommerce Products
- WP_Query displaying ALL posts
- What is an efficient way to query based on post_meta?
- Highlighting Sub topic in a post?
- how to retrieve specific product attribute value in an sql query?
- How to get sum of meta_values of a meta_key in wp_query according to conditions
- Best approach to create Hot and Trending sections
- WordPress custom archive page
- WP_query category__in not working, only pulls from first category
- Retrieve or Query Pages by ID
- Order posts by meta value and Date
- How to make orderby ‘meta_value_num’ OPTIONAL?
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- How to do a query on custom taxonomies that is uncategorised?
- Empty tax_query array returns an empty array
- Meta Query for specific months
- How do I search inside specific taxonomies in WordPress
- Different string for specifed post type on posts listing at homepage
- How to correctly pass values to wpdb->prepare()?
- WP_query posts closest to todays date
- Setting get_queried_object
- remove query arg from url after set query
- exclude posts with a specific custom field and value
- difference between like ‘%%%var%%’ and ‘%var%’
- only delete post within query / for each statement (front end)
- Get attachment by meta_key value
- Sort query by author: 1 author, then others
- Using hook to use DISTINCT in a wp_query
- Overwrite YoastSEO meta-tags with another page’s [closed]
- How to orderby multiple meta fields if some fields are empty
- How to duplicate 5 posts out of WP_Query results?
- Where to put meta Keys
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Slow queries on a huge database
- Large AND OR query timing out
- Multisite pagination issue by multi query archive 404
- Query with relation and one without relation using multiple taxonomies?
- get_post_meta slowing down my page load (in a plugin)
- Is there a reason why Pages are not publicly_queryable?
- Check return value of get_posts
- Transient api Caches confused
- How can I override one post and make it display content for another post?
- Get multiple users with meta value in one query and populate WP_User class
- Get a list of posts by specific category
- Shortcode for custom query not returning results when attributes are added
- Woocommerce: order posts by meta key
- Display post meta conditionally based on it’s value
- Filtering by multiple conditions in the loop
- Sort by custom field that is an array?
- Display count number of posts with the same specific meta_key meta_value
- Post incorrectly excluded when using “category__in”?
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- Sort by price wpdb
- Meta query ignores multiple values of the key
- Any way to use FETCH_KEY_PAIR with $wpdb?
- How to query users by post count no less than 10
- WP Query. Ordering posts by another post types meta
- How to make a search query if not found in post table then search in postmeta table?
- update_post_meta() not updating
- WP_Query about meta_key and its array value
- Create global array to compare inside a query
- I can’t get post based on its postmeta value and key
- how to show more than 1 post into three columns query
- Using the same WP_Query for shop and widgets in WooCommerce shop
- How can I get all the posts that are related with a specific taxonomy term?
- Custom query for tag and custom tag from 2 post type
- wpdb get_results() returns only 2 rows
- Filter posts/pages by user_role array
- WP_Query secondary query failing
- Search Functionality broken by the wp 4.2 update
- Issue attempting a wp_query_posts with tags
- WP Query to order posts by multiple meta fields
- Custom Search Query – include only custom fields and title
- add_query_vars does not work
- Retrieve posts in custom post type and specific taxonomies
- Custom post types loop on a page template
- Parsing External Table Arguments
- Get Child Custom Post Content on Single.php?
- difference between methods of query
- How much does $wpdb->prepare(), then $wpdb->query() VS straight $wpdb->query(), can slow down the load time of whole page
- how to use transient method?
- Pre_get_post on CPT archive page
- Get posts that were most recently tagged
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise