$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
- WordPress duplicating posts from single loop
- Custom fields disappearing when a custom post type is assigned
- Advanced search form with filters for custom taxonomies
- custom post type search by reference id
- Advanced custom field boolean value in custom post type
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Sort a custom post with ACF: Date Picker & Display Featured!
- Using wp_query to modify the loop in index.php for a CPT
- Custom WP_Query doesn’t display all posts
- WP_Query() with custom post type and taxonomy — get all terms?
- Query & the_content() is showing in the header
- Variable not working in WP_Query
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Pagination not working on custom query on a page
- Query within a foreach within a query (queryception)
- Custome fields not displayed
- Create short URL with auto 301 redirect
- get custom post type value in header.php [closed]
- How do I get_the_postID() for a custom post that uses ACF repeater field?
- Custom post types, disable fields
- Post ordering not working with custom field
- Query Custom Post Type by Taxonomy
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Related “custom post type” using “custom taxonomy”
- Page that lists publications by classifying them by taxonomy
- count & sum the value of custom field of the author post in dynamic posts
- Display a Custom Post Type with Advanced Custom Fields on Homepage
- Same custom post type with different ACF
- Subpages URLs for Custom Post Type
- How can I get custom post types to recognize pretty permalink variables?
- Error in the page of a CPT file in WordPress
- How to show link to product in custom fields?
- How to display grandchildren only of custom post?
- Sort custom post archives by a meta value from a different custom post type?
- WP_Query based on ‘s’ and tax_queries
- post type => ‘any’ not applied my custom queries
- In the admin, how can you list thumbnails instead of titles for a custom post type?
- Query the title of the page to show posts with matching category in the loop
- WP Query tax_query not returning posts
- The most recent post of custom taxonomy
- Showing custom post user wise with different color in wordpress
- Problems with the WP_Query query for a Custom post type
- Main site single-property.php design, as homepage of a multisite
- Query pulling all taxonomies, not one I am specifying
- Insert single CPT items every x posts of another CPT
- Can’t seem to filter wp_query by current category ID
- why custom post archive gives always no more than 10 posts despite of paging settings?
- Filter Content on all Post Types
- WP_Query with custom post type search showing all results every time
- Advanced Custom Fields – Add Field to Specific Page [closed]
- Post data in separate divs with incrementing class using WP_Query
- Selecting posts older than the current Unix epoch timestamp
- How to list groupings and keep pagination
- How to retrieve taxonomy terms of the current custom post?
- Change display wp post type to wp custom post type
- Query recent posts by author
- Create a list of months based posts
- WP_query orderby not working after WP4.0 update [closed]
- How do I correctly query posts from a post ID?
- Custom post type and have_posts() return empty result
- How to alter query so that image changes in order every time page is refreshed
- Create a WordPress Database query to find users who purchased specific product through WooCommerce [closed]
- Searching Custom Posts content with JQuery
- Store custom post type with JSON content
- Create WP multisites as a custom post type
- Creating a Single Instance Custom Post Type with Limited Module Options using ACF and WPGraphQL
- How can I filter records in a custom post type list in the admin based on the ACF field in the post that contains the current user?
- Query by “similar” post title
- Generate list of posts on a page, but fill shortcode values from ACF fields on that page