When using a custom query, in order to access the $post
information, you need to reference post
as a class variable the custom WP_Query.
Since you constructed the query as:
$hw_selectbox_query = new WP_Query($hw_selectbox_args);
Then you would access the post
variable of $hw_selectbox_query
, like so:
var_dump($hw_selectbox_query->post);
This will give you the information you need / want to build your $field
array.
Related Posts:
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- How to list some posts first in the loop based on post id
- How to order posts tag by tag?
- ACF – Get lowest & highest value from field
- Multiple taxonomy And acf filter group by
- Any number in meta key (wp query)
- Excluding pages in WP_query using ACF
- Stuck in the query loop
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- Expecting statement error from php loop using ACF plugin
- Filtering by multiple conditions in the loop
- relation OR instead of AND – Filtered term ID’s in loop
- Why does apply_filters behave different inside and outside a loop?
- Populate select list with meta values from all posts of a Custom Post Type
- ACF: How can I publish values of ACF fields in a loop while using wp_query?
- WP_Query doesn’t works inside loop
- Issue in If else condition [closed]
- Creating array to compare custom field values
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- WP_query shortcode inside acf Repeater breaks the repeater loop
- Some doubts about how the main query and the custom query works in this custom theme?
- Using a custom WP_Query with get_template_part loop
- Loop within a loop?
- ajax category filter
- Display posts the match taxonomy term linked from wp_list_categoies?
- WordPress Custom Query to show posts from last x years
- Merging a complex query with post_rewind and splitting posts into two columns
- Pagination Not working on Home Page with 2 Query
- meta_query not working properly
- How to get any tag ID
- Exclude post on loop by multiple meta key value
- Sort by meta key on archive page
- Query sticky posts with thumbnails
- Show all parents and children in custom post type in right order
- Why is this coming back as null? Thats wrong. There is one post
- Ignore post by meta value in the main query
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- What’s the point of the query_vars filter?
- How to retrieve current page WP_Query arguments?
- How to limit WP_Query to one result on the loop?
- When to add_filter() to Custom Query
- Random loop with code to prevent duplicate output returns no output at all from time to time
- How to use offset in WP_Query
- How to use filter hook “the_posts” with a function that refers to $this?
- Multiple loops without repeating content
- Can I set my WP_Query to be a Main Query?
- Group and list posts by custom taxonomy
- Show scheduled posts in main loop but not in WP_Query?
- Change query based on post type while staying in loop
- Bypass “supress_filters” in WP Query
- Get a list of posts with associated meta_value
- $WP_Query: How to display excerpt on first post only
- How to make search for posts using get method?
- How to get list of posts from permalinks?
- How to filter a query by date in a shortcode?
- get_template_part causes 500 error
- Assign custom parameter to each post in query
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- WP_Query – Adding “offset” posts to the end of the loop
- Conditional operator OR not working with custom fields
- Get posts that do not have the same tags as current
- wp_query is showing posts from other categories
- Should I reset $wp_query?
- Exclude a Woocommerce product from WP_Query
- WP_QUERY wrong ammount of posts
- How to add sort order to incremented and paginated category loop
- How to remove only the latest sticky post from the loop
- How do I sort this custom list of sticky posts
- Query only displays one page_id
- Get posts with no tags?
- wp-query, pull children of parent page
- I am officially missing something about transient posts
- How do I get the content of a custom instance of WP_Query?
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- Show a message if there are no active posts in category
- Query for getting posts with their custom fields data in WordPress
- Problem with my loops
- display the children of the post using the current page as the main parent
- Display 3 levels of categories on page
- Query string order by custom field
- Paging works correctly on local version, but not live?
- Custom post type loop error: Trying to get property of non-object
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Display three sequential posts on each page load, without repeating previous
- How to make a wordpress loop file that displays posts based on certain conditions
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- Pagination not working with WP_QUERY
- How do I display posts with specific value in a custom field into my loop?
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Order by multiple meta keys on wordpress
- wp_query pagination links producing 404
- Display First posts without the default featured image
- Pagination problem with multiple loops on the same page
- Can’t seem to get an else statement correct? [closed]
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- List categories using WP_Query
- How do I subquery with custom meta fields?
- Show number of posts AND number on current page (cannot make it work)