$show_date = get_field('show_date');
$show_venue = get_field('show_venue');
// print '<pre>';
// print_r($show_date);
// print '</pre>';
$query->the_post();
You are setting the active post AFTER getting the values.
Put $query->the_post()
always at the top of that while loop, so that the other functions can rely on the global $post variable being set correctly.
Related Posts:
- Filtering a WP_Query meta_query by numeric values isn’t working
- Query by 2 values of a repeater ACF field
- Query current and future events, ordered by begin date
- Display posts if a custom field value is equal to another custom field value
- Remove duplicated values from a loop
- Custom Post Types not showing, custom WP_Query
- Custom Post type and Custom Field WP_Query
- Display multiple custom post types and sort them chronological by one of their fields
- WP_Query order by custom field, then randomly order some of results
- Troubles with acf/save_post and WP_Query
- Query custom post type with ACF Date
- Stuck in Order by more then one
- Order Custom Post Type by Custom Field Value
- Query Custom Post Type Taxonomy term with multiple parameters
- Query based on custom fields start and end date
- Group by custom field value (start and end times)
- Using WP meta query to show custom post types by a start and finish date
- Create if else for post types in WP_Query ‘post__in’ values
- Sort custom posts by date and then by taxonomy
- Using ACF values in nested WP queries for CPT with date values in the past
- Filter posts by their related field’s custom field
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- Show specific posts with WP_Query using ACF Post object
- Linking posts together with Advanced Custom Fields “both ways”
- Custom Field as Custom Post type element class
- How to query posts by meta keys AND under specific category?
- Custom Post-type not returning the right child_of
- Display ACF object field data using Elementor Custom Query
- WordPress WP_Query Sort by 2 dates – custom fields
- Exclude a category from WP_Query
- Single loop for wp_query and wp_user_query
- WP_Query orderby custom field then post_date in one query
- query multiple taxonomies
- Custom Post Type, WP_Query and ‘orderby’
- Include post id[s] into WP_Query()
- Grab 5 latest posts from custom post type ‘announcements’
- Pagination Doesn’t Work
- Numeric pagination custom post type
- List with categories, subcategories and posts of custom posttype
- Sort the main query in subcategories/terms?
- Can’t sort order of wp_query with 2 meta keys
- Get post info inside modal window?
- Get count of custom post type created by current user
- Query Custom Post by Category
- Pagination Issue: Custom Post Type In Index
- Having trouble with custom date field for CPT query (WordPress)
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- How to use WP_Query in a CPT achive page?
- Use get_post_types to query only custom posts types
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- Rewrite WordPress URL to show CPT meta field data
- Pagination on a custom post type loop
- WP_Query orderby modified to include custom meta changes
- Wrong request query on cpt and tax
- What’s the WP way to load remaining custom posts?
- Filter Posts from the Main Query
- Print current post category during WP_Query
- ACF repeater field usage
- Pagination 404 on Index with custom query
- WP_Query parameter conflict
- Retrieving meta-box from a custom-post-type
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- Batch Extract Date from post title and put into ACF custom field
- Display custom post type for specific user
- Custom Post Type Archive Pagination
- List all Custom Post Type posts excluding certain Taxnomy term
- Custom post type pagination error
- WP query_posts group by meta field related
- How can i show ACF in post excerpts
- Apply category query clause to posts of custom type
- custom post type and a “sticky” position taxonomy
- Display post count for a specific month
- Query to Exclude Child Pages from Custom Post Type Archive
- WP_query has incorrect wp_posts.post_name = ‘asc’ when I have custom post type called ‘order’
- Randomizing WordPress Custom Post Type Sorting Through Them Without Page Refresh
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- How to output custom post type title on custom page with category next to it?
- 2 modal windows with ACF content on Archive page
- ACF meta_key and meta_value break loop
- search results to show individual ACF fields from inside custom posts
- Custom Post Type – Display all, wrap in groups of 3
- Staggering featured post using ‘sticky’
- Ajax load more inside custom post type taxonomy
- Use output of wp_dropdown_categories($args)
- Create a custom wp_query from a specific custom post type with specific taxonomy
- Values show up in custom home page but not in custom post pages
- Query breaking with ‘posts_per_page’ => -1
- WP Query with multiple post types ordered by custom meta date then published date
- Query Pulling the same post twice
- $post breaking container loop
- WP_Query get posts where post_name is empty
- How do I sort post listing by child post count?
- Querying meta values within an array
- Filter Custom post type by another Custom post type
- Archive page – problem with pagination
- Retrieve a post with its ACF repeater fields in wordpress
- Assign a tag to custom post type using a query
- Post object GUID adding http:/
- Query order by a numeric ACF field