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
- what is the correct way to compare dates in a WP query_posts meta_query
- Multiple orderby values in WP_Query
- Using meta_query, how can i filter by a custom field and order by another one?
- Return all custom meta data for one custom post type
- How to filter custom posts by tags and custom fields?
- Custom post type archive 404’s with paginate_links
- Search multiple custom fields by using meta_query
- WP_Query orderby custom field then post_date in one query
- how to filter by last name for custom post
- Filtering a WP_Query meta_query by numeric values isn’t working
- Sorting a query by custom field date
- How can I generate a RSS feed based on a custom WP_Query?
- Filtering a WP Query result
- Retrieving 3 latest post from each of 5 different custom post types
- How to hook get_terms() to only show count of posts that have custom meta
- Search Custom Post Type with all meta attached?
- 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
- Using Query Posts With Multiple Post Types And A Taxonomy
- How to get the parent’s taxonomy?
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- WordPress query by multiple Custom fields and order by date
- Comparing timestamps in meta query doesn’t work
- Cache issue with WP_Query and custom field filtering
- Display Posts Query with IF function
- 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
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- Custom wp-query display post only today
- Custom Form / Search with Custom Post Type Data
- Create if else for post types in WP_Query ‘post__in’ values
- WP Query from two Custom Post type fields as statement
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value
- custom post type and a “sticky” position taxonomy
- 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
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- 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
- Sort custom post archives by a meta value from a different custom post type?
- 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
- Query the title of the page to show posts with matching category in the loop
- 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
- Main site single-property.php design, as homepage of a multisite
- Query events post type after current date and timezone
- Imported Content Doesnt Show Up On Frontend
- Calling specific page with wp query
- WordPress custom post type
- How to stop wp_query searching pages as well as the specified CPT
- display news with pictures 3 small and one large (loop)
- Selecting posts older than the current Unix epoch timestamp
- Query Distinct Taxonomies of Custom Post Type
- WP_Query and two custom fields returns no posts
- Custom Query With Multiple Meta Key Value
- Custom post type blog pagination conflict
- WP_Query get posts where post_name is empty
- Storing/querying custom date data
- Query Posts From Multiple Post Types
- Query recent posts by author
- 404 on Pages for Custom Post Type & Query_Posts
- send user to first page of results when reposting to page?
- Querying meta values within an array
- How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Filter Custom post type by another Custom post type
- Show Posts in Vertical Tabs with Scrollbar
- How do I correctly query posts from a post ID?
- 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
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- WordPress custom field sorting, weird behavior: the latest post is at the end
- Assign a tag to custom post type using a query
- 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?
- Query order by a numeric ACF field
- WP_Query not using relation key as expected and not producing any results
- Use Custom Field to Display Post Loop