Custom fields are saved in the post_meta table. In your query you got the post title and post ID, so now you have to get post meta.
Use:
<?php
get_post_meta( get_the_ID(), '_location', true );
?>
same for the rest of your custom fields only ‘_location’ will change according to field you are getting.
Read more about post meta here
Related Posts:
- WP query_posts group by meta field related
- Display ACF object field data using Elementor Custom Query
- Multiple orderby values in WP_Query
- Return all custom meta data for one custom post type
- Custom post type archive 404’s with paginate_links
- Search multiple custom fields by using meta_query
- how to filter by last name for custom post
- Sorting a query by custom field date
- Filtering a WP Query result
- Retrieving 3 latest post from each of 5 different custom post types
- how to group custom post type posts by custom taxonomy terms
- order by meta_value serialized array
- How to sort CPT by custom meta value (date), and return posts month by month
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Comparing timestamps in meta query doesn’t work
- WP Query group/order by category name
- Query for posts in 2 taxonomies
- Display custom post types with custom date field value (before today) & order by custom date field
- Conditional to modify query results
- Multiple post type queries (with specific arguments for each)
- wp_query to find posts by year and month
- How to dynamically attach pictures to a carousel
- Get all Posts If has same custom field values in Posts
- Sorting multiple custom post types without a meta key/value pair by sort order
- Including Custom Meta with posts_where query
- WP_Query: include custom post type only with specific meta value
- WordPress custom loop filter by meta_key and value with serialize data
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- wp_query check if integer exists in custom field’s array
- Get latest 3 posts from multiple CPT in one query
- How can I get the number of custom post type posts that have a specific attachment image set?
- Problem querying Custom post type by custom fields
- Orderby CPT custom fields not working
- Query custom post type with ACF Date
- Including metaboxes from custom post types in global search — continued
- Query Multiple Custom Posts by Custom Fields
- Order Custom Post Type by Custom Field Value
- First custom field value (out of several) displayed twice after query
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Different Ways to Query Custom Post Types?
- Possible to filter custom post type with multiple meta data?
- How to make WP_Query not to show irrelevant posts?
- Loop for custom post types filtered by a taxonomy
- WP Query ‘posts_per_page’
- How to get specific post meta by title or id
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- find custom post type post by searching its custom field with my string
- FacetWP paging custom wp_query
- Custom Post type loop with ACF not displaying properly
- Can’t change posts per page in WordPress Post Type Query
- postsperpage value not being applied
- Group by custom field value (start and end times)
- Incorrect ordering of custom post type based on time
- Cache issue with WP_Query and custom field filtering
- How do I list a custom field and custom taxonomies for each result in a loop?
- Custom Post Type Query W/Category Dropdown
- Find Posts based on Child Post value
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- Custom Form / Search with Custom Post Type Data
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- WP_Query get always custom post_type for first
- Sort custom post column by generated value?
- How can I query and sort custom-post type using WP_Query
- Use WP_query to match post types based on custom field values
- Filter posts by their related field’s custom field
- Query custom post type and custom field by URL parameters
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- meta query multiple values for the same key
- Custom post types – meta_query: search lesson which starts sooner
- Post Filtered by Custom Field Value
- minimize wp_query call to database
- Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?
- sorting in wp query based on custom field value
- Meta_Query refuses to return results
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Error in WP Query. If variable is empty it is displaying previous post value
- Query events post type after current date and timezone
- Imported Content Doesnt Show Up On Frontend
- WordPress custom post type
- How to stop wp_query searching pages as well as the specified CPT
- Query Distinct Taxonomies of Custom Post Type
- WP_Query and two custom fields returns no posts
- Custom Query With Multiple Meta Key Value
- Storing/querying custom date data
- Query Posts From Multiple Post Types
- 404 on Pages for Custom Post Type & Query_Posts
- send user to first page of results when reposting to page?
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- How to exclude certain portfolios from a loop
- How to show all posts of specific custom post type with their custom fields values?
- querying to custom field over ACF REST API
- WordPress custom field sorting, weird behavior: the latest post is at the end
- Sort CPT by taxonomy AND THEN by custom field
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?