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
- WP_Query filtering in ACF field containing dates
- Resetting post data to previous loop in nested loops
- Whats the difference between post_limits and pre_get_posts?
- How to add taxonomy filter on the query fly?
- Make loop display posts by alphabetical order
- get custom post type by tag
- Group posts by custom field
- Revolution Slider Orderby Two Custom Fields
- Transient pagination not working properly
- query posts in functions.php and update a field
- get_posts() seemingly ignoring post_type
- Woocommerce custom loop to show all the products [closed]
- Which filter/action hook gets triggered after a query has been performed?
- How to show the posts of some category first, and then all other
- Pagination stops at page 6
- Paginated HTML Sitemap
- Why does the_content not work like others for a set post id?
- How to limit total number of posts in wp query loop?
- Minimising Database Queries when using Advanced Custom Fields
- WP_Query meta_query >= date
- Pagination is broken and I need help fixing it
- Query total number of posts
- How to add post_distinct filter to WP_Comment_Query?
- Using Ajax to load more posts | Help me change the wording on my button to notify the user
- Get a post from other loop each n-posts in the main loop
- Loop returning only 1 result
- Filter posts in category archive page by year using a dropdown
- Show post number in widget loop
- posts_per_page not working for first page of pagination
- Loop Performance > JSON files vs. WP_Query vs. REST API
- Add class to first post in custom loop using post_class filter
- Search form not working with custom query?
- WordPress ignoring LIMIT / posts_per_page despite being in wp_query
- Conflict with get_posts and the_content
- WP_Query with meta_query dosen’t return results
- How to filter a query by date in a shortcode?
- get_template_part causes 500 error
- 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 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
- 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
- How to get rid of extra Untitled Article in html5 document outline when using new WP_Query?
- I need to get all categories from a WP_Query
- after refresh the id that shows correct in first time click, changes to 1
- Unexpected number of loops in while
- How to display only posts from the last day with posts published?