You can alter your foreach loop as following to get concert date and city pair in single multidimentional array as following.
$concert_query = array();
$i = 0;
foreach($c_query as $post) : setup_postdata($post);
$concert_query[$i]['concert_date'] = get_post_meta(get_the_ID(), 'concert_date', true);
$concert_query[$i]['concert_city'] = get_post_meta(get_the_ID(), 'concert_city', true);
$i ++;
endforeach;
print_r($concert_query);
Related Posts:
- Custom field to array?
- Query Posts or Get Posts by custom fields, possible?
- Can I query custom meta data through WP_Query
- Using get_posts with arguments found in meta keys
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- WP doesn’t show Array Custom Fields?
- How do I search an array stored in a custom-field using WP_Query?
- Is it possible to store arrays in a custom field?
- Loop through two different sets of custom fields
- Saving an array in a single custom field
- Order posts according to user defined order for meta values?
- Get specific custom field keys from a post and put into an array
- WP Query Returning All Posts
- Passing Custom Field Data as Array to be Saved (Resulting Custom Field Array is inconsistent)
- get_posts that match a user-specified value on a page
- Run a check for multiple meta key values
- If meta key exists in get posts function otherwise create it
- Create an Array of Specific Custom Post Meta
- get_posts that haven’t been assigned a specific custom field
- Remove Body Classes
- Meta Query returns wrong number of posts
- How to find a post using XML-RPC without knowing ID
- Sort alphabetically by custom field
- get_posts in meta box dropdown not showing latest posts
- get post id using custom filed value
- change order of images attached to post
- Loop through incrementing custom fields
- query_posts with meta_value
- Displaying an ACF list of users
- Meta value Array
- Show array of meta_value in Edit Post Coloum
- How to Convert Custom Fields from Text to Array?
- Custom field outside the loop and inside an array
- Get custom post fields from multiple metaboxes
- Working with multiple values and metaboxes
- Custom Field: how to save array of multiple key-values in WordPress
- How do I display an article using a WordPress custom field?
- How to save array option as text and not integer?
- Should I store arrays in custom fields or create custom tables?
- How do I use foreach to get content from a custom-field in multiple posts?
- get_post_custom_values not working
- Adding custom field to an array
- How do i output images from URL’s added to the same custom field key
- Extract array from custom field
- Build Array from Input Fields question
- Custom fields: Split data from single custom field’s sub-array to separate custom fields when saving post
- Custom query with orderby meta_value of custom field
- How to enable revisions for post meta data?
- Any way to add custom options to Gallery Settings?
- Including custom fields in search?
- How to display all custom fields associated with a post?
- passing argument to get_template_part() or a better way to code
- Bulk move (or copy) from a custom field to the post content?
- Populating meta box with select-list of existing posts, and assigning it to custom post types
- Display value of custom field not working
- Can you ungroup Custom Fields?
- making sense of admin-ajax
- MySQL query to set wp_postmeta using term_taxonomy_id value
- Insert attachment ID in custom field from media uploader
- Bulk remove post meta
- How to Display pages with a Custom Fields in one page
- WordPress Rest API to call page data associate with custom meta
- Unsaved changes in metabox inputs not detected in the block editor
- Declaring in variables [closed]
- How to populate custom field dropdown box based on prior selection?
- Saving Custom Field Data before Publish
- Hook after meta created
- Inserting data into MagicFields using mysql queries
- Custom Field box history
- Check & remove special characters in a field?
- Google map that plot’s several markers – each one with custom data
- Get emails from users by custom field SQL
- Why am I getting a “Call to member function format() on a non-object” error?
- How To Show Get Adjacent Posts If Posts Are Sorted By Custom Field
- How to calculate custom field value (average)
- Modify custom field from front end
- How to get all custom fields with some prefix in key?
- Use update_post_meta to older posts
- Best way to insert a list of links into a post outside of the_content
- How to add a post’s view count into the WordPress API response
- WP meta_query args not working in function
- Line break description wordpress
- Update custom field on the fly
- Custom field disappeared from screen options
- Contact Form 7 List Building
- ACF – Compare user and post data
- Advanced Custom Fields deleting some code and adding code for a slider
- How to format the various types of custom fields?
- Get first URL from custom field, download and set as featured image on post publish
- How to add an option to admin to add image that could be used as header?
- How to query posts that have certain post meta keys, and sort by meta key and/or value
- sort a custom field base on the date or anything
- Add image custom attribute [closed]
- Retrieving custom field as shortcode
- Foreach giving one too many list items, how can I remove the last empty line?
- I used a custom field for header image and can’t get it to show up on posts
- Dynamically update Custom Fields to display new dates
- save all acf options in one meta_value [closed]
- Can running a WP-Cron to update_post_meta cause performance issues?
- custom field value is blank or empty