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
- Advanced Custom Fields: how do I check to see if a value is set in an field? [closed]
- WP_Query – Order results by meta value
- Add filter menu to admin list of posts (of custom type) to filter posts by custom field values
- getting all values for a custom field key (cross-post)
- How to add a custom field in the advanced menu properties?
- Custom query with orderby meta_value of custom field
- How to filter post listing (in WP dashboard posts listing) using a custom field (search functionality)?
- Using meta query (‘meta_query’) with a search query (‘s’)
- Can I exclude a post by meta key using pre_get_posts function?
- Add validation and error handling when saving custom fields?
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Show Custom Fields in Quick Edit
- Where are custom field values stored in the database
- Validating Custom Meta Box Values & Required Fields
- Max length of meta_value
- Add custom fields to wp native gallery settings
- How to fix missing custom fields after upgrading to WordPress 4.8.1?
- How to enable custom fields for pages (if not a bad practice)?
- How can I add extra attribute in the ‘Page Attribute’ section in wp-admin for pages?
- Is there a way to set default custom fields when creating a post?
- Custom post meta field effect on the performance on the post
- How to get custom post meta using REST API
- Custom field/meta populated by dropdown of existing posts?
- Difference between meta keys with _ and without _ [duplicate]
- Is there any action filter/hook for validating a custom field before publishing the post?
- Remove Dimension from wp_get_attachment_image
- Orderby meta_value only returns posts that have existing meta_key
- Underscores in custom fields
- What is the index [0] for on post meta fields?
- What is “meta_input” parameter in wp_insert_post() used for?
- How to enable revisions for post meta data?
- Sortable Custom Columns in User Panel (users.php)?
- Any way to add custom options to Gallery Settings?
- The “_encloseme” Meta-Key Conundrum
- ORDER BY custom field value
- Individual Widgets per Page
- Add subtitle to Woocommerce product title
- Best way to programmatically remove a category/term from a post
- Importing data for advanced custom fields plugin?
- Gutenberg add a custom metabox to default blocks
- SQL Query to copy value of a meta_key into another meta_key
- ‘Preview Changes’ for custom meta boxes?
- Adding a custom field to the site identity menu
- Using TinyMce with textareas in meta boxes on custom post types
- Filter WP_Query for posts having a certain meta-value
- How to correctly call custom field dates into a posts_where filter using SQL statements
- Using get_post_meta with new_to_publish
- Is there a way to get protected meta fields through any of the available built-in WordPress APIs? (xmlrpc, wp-json)
- Add a Jquery Datepicker to custom field in post edit
- add meta box – custom field : which to choose?
- Preserving line breaks when saving and displaying custom fields data
- How to return Meta data from the REST API?
- Advanced Custom Fields – Get custom fields from parent page
- Add custom field to the archive page?