It’s still early for me, but you need to check for if( $events_query->have_posts() ) : rather than if( have_posts ) : as the latter will be checking against the current post type and not your custom query.
Related Posts:
- next_posts_link and previous_posts_link problem
- Block Editor – WordPress 6.1 – CPT Archive Issue – While the title changes in the loop, all records display the same data
- WP_Query for WooCommerce Products
- How to know if get_posts() failed?
- Get category slug and display it on a query_post
- Is there any need to use both wp_reset_postdata and wp_reset_query together?
- Custom post type archive sorted and grouped by date in post meta field
- query posts in wordpress
- How do I display the “Archives” widget layout (sidebar) in WordPress by ‘year’ then by ‘months’?
- posts_nav_link(); not showing up on static pages
- Get list of months with posts
- Why is the first query affecting the second query, even after wp_reset_query() and wp_reset_postdata(), but not on the second page?
- Tell wordpress to show a single page instead of an archive
- is_main_query() not working for WP REST API
- Custom URL parameters in template files
- Metadata Query when storing data as array possible?
- List of the years with posts presented
- Archive page doesn’t work
- Keep sticky posts out of query unless they have featured image
- How do I build a post_thumbnail based archive? [closed]
- Two loops on archive page
- How to override p2 breathe theme plugin in content template file?
- Check if loop has any categories?
- How to query the latest 5 posts and sort them by title?
- 2 loops, is_home won’t work, count is off
- How can I prevent posts with no title showing up in my query?
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- CSS class on last post in loop ( custom query )
- How to order by multiple date meta_values?
- Create a category archive page in TwentyTen Child Theme
- How to create query to get top 3 sticky/latest posts
- how to make wordpress change the title and keep page name?
- I have WordPress setup on primary domain, how do I set it up on its subdomain using the same database?
- WP_Query not getting all posts, just tagged posts
- tag__in does not return posts
- View list of all attachments on site
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- multiple queries to get posts from same category?
- Best practice for implementing a blog page / section in wp_menu_nav()
- Is there a template tag I can use to link to the archive page corresponding to the month that a post was published on?
- Designing a custom archive.php inspired by the Autofocus theme
- Archives and Categories in Custom Menu
- How to get a random single category name in get_posts()?
- Tell wordpress to show a single page instead of an archive page
- Custom Post Type archive page listing a 404 or single post
- Second page of archive is empty
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Not the typical order by posts by date question
- Paginated WP_Query doesn’t return 404’s, even when posts don’t exist
- issue displaying variations in custom template using WPeC 3.8.9.2
- Main loop querying current template’s info only in custom category archive pages, not my posts
- Wp_query WooCommerce products
- Querying by post category slug with core/query block markup
- How to use meta_query to retrieve posts from multiple custom post type
- When to use add_action(‘init’) vs add_action(‘wp_enqueue_scripts’)
- Change admin bar to default:off
- How to add Color Picker in Theme Options for the following?
- Template for individual post designs
- Theme Review: post thumbnail, header image, content width
- How to determine if a category is empty?
- The seventh parameter passed to add_submenu_page()
- What would happen if the admin installs a plugin when the plugin is included in the theme?
- How do I get my child-theme to work with my theme’s includes folder?
- How wordpress handle upload images and how to use them in the code
- Change loop order via form or link (jquery, not URL)
- how to create theme based widget that can be drop in sider bar or footer
- CSS in child theme not overriding the parent theme [closed]
- Template Hierarchy for get_header()
- Remove frameborder attribute from iframes
- List the 5 most recent child pages
- how do I get a sidebar’s id or number for use with is_active_sidebar()
- Looking for the code in twentyten that allows users to select images for the header/banner
- How to test for MU via functions.php?
- List categories and exclude child categories
- Am I supposed to create a child theme for every theme I use?
- WordPress as a data intensive web app
- How to determine which custom header image is being shown
- using wordpress without javascript
- Theme Check: Could not find post_class
- Override theme programmatically
- How can I get the query that would be run for the archive page?
- How do I remove TinyMCE text format
- can’t understand _e function well
- WP 3.1 upgrade breaks AutoFocus+ theme
- Theme Splash Image within the “Appearance -> Themes” control panel [duplicate]
- Change content layout based on menu hierarchy
- Theme Loading Into Dashboard
- How to make theme elements customizable in wordpress?
- Can “Recent Posts” widget be filtered by functions.php?
- attachment.php code or tutorial
- How to filter or remove the “title” attribute from category links
- Change “Thumbnail”, “Medium” and “Large” image sizes using functions.php?
- How to obtain a reference to the_excerpt() from custom loop
- defining a folder location in order to recall it
- Remove CPT slug from URL WordPress
- JavaScript stops working on selectively refreshed sections one inside the other
- Query posts intersecting tags and categories
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Why doesn’t my css work when I check my theme on mobile devices? [closed]
- WP_Query orderby and tax_query