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
- Get the type of an advanced custom field (ACF) in a WP_Query loop [closed]
- Sorting Posts Based On Meta Value Using AJAX
- Next / previous posts link doesn’t show up with Posts 2 Posts
- How to exclude posts ordered by comment_count from subsequent wordpress loops using WP_Query?
- Loop the posts between two dates selected using jquery datepicker
- Order by multiple meta keys on wordpress
- query post based on comparison
- Query posts filter not working
- No content found on page 2 of pagination with 1 post per page
- meta_query dates from an array
- wp_query pagination links producing 404
- Converting an existing query_posts to WP_Query
- loop through custom post types with meta data
- Display First posts without the default featured image
- Pull Instagram images into an existing loop?
- Loop being strainge
- Using Query In Post Type Archives
- Do not show a custom post if it belongs to a certain custom taxonomy
- Multiple loop for “featured” items returns wrong posts
- $query conflicting with other queries in the same page
- How ‘secure’ are loops?
- Pagination in custom query not working [duplicate]
- Multiple loops on index page with sticky post and pagination
- Pagination problem with multiple loops on the same page
- Problem with WP_Query sort
- Display all custom meta field values from the database using ACF Repeater
- WordPress Post Looping? [duplicate]
- How to do a loop inside a loop?
- Carousel Loop only duplicating
- Remove 5 latest posts from the loop
- Exclude post formats in custom loop
- How do I show the post title if an advanced custom field hasn’t been used?
- wp_query->set for several categories
- Get author meta data with no published posts in author.php?
- Query for page content, and query for posts on the same page?
- Can’t seem to get an else statement correct? [closed]
- Adding arguments to WooCommerce Product Loop using AJAX
- Help with showing text when something is entered in my search bar
- How to write a query-function as a query-shortcode?
- How to show featured post first, then separate loop for other posts
- Main loop querying current template’s info only in custom category archive pages, not my posts
- Print post data inside loop using theme content template
- Show linked products using wp query and woocommerce
- Standard Loop – wp_query
- tax_query not working properly with get_posts
- Edit WordPress loop, taxonomies, & filter
- First post outside of loop, homepage only?
- the_excerpt() not working in custom archive
- How can I display sticky posts at first in wp_query?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom Wp_query loop takes very long
- Filter page ID outside the loop and order
- List categories using WP_Query
- Get posts using multiple values from ACF checkbox as meta query wordpress
- Prevent WordPress loop from displaying similar post titles
- Custom query for certain post type OR another post type with a certain category
- I want to place a post before all others from an ACF boleen field
- How do I subquery with custom meta fields?
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen
- Show number of posts AND number on current page (cannot make it work)
- How to get rid of extra Untitled Article in html5 document outline when using new WP_Query?
- Custom WordPress loop, articles not in same order as Array
- I need to get all categories from a WP_Query
- Best performance for use Custom Field in WP
- after refresh the id that shows correct in first time click, changes to 1
- Use value from meta key array for use in WP_Query
- Pagination only showed when no category is set in wp_query
- WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)
- Unexpected number of loops in while
- Splitting query results, on the frontend, into separate sections based on meta value without multiple loops?
- How to use meta_query to retrieve posts from multiple custom post type
- How to display only posts from the last day with posts published?
- Multiple queries and pagination
- filter the custom post type using wp ajax request
- Loop a Single Taxonomy and Output all Posts Associated (but also show a message for empty ones)
- Include custom post type that matches taxonomy field in another custom post type
- Grab IDs of products from WP_Query which is run elsewhere
- WP_query with ajax filter not working with input fields