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
- old content are still displaying after using wp reset and clear cache
- WordPress Custom Search By Alphabet and order by asc and sesc
- Search Functionality broken by the wp 4.2 update
- Best way to access variables in template markup
- Issue attempting a wp_query_posts with tags
- what is do_action(); in wordpress? [duplicate]
- How To Customise WordPress Comment Submit Button?
- Automatically Add Caption Shortcode to Image with Caption Field Filled In
- Adding a space between next and previous post links
- Next post in category
- Next/Previous post navigation
- Primary Menu Showing All Pages With No Sub-Nav
- get_theme_mod not pulling css colors into header using wp_head
- How to query post into a complex slider
- Why WordPress gets old templates code instead of the last updated ones
- Duplicate WordPress site to subdirectory but use same db?
- Recent post in the middle of the content
- Customizer API way function is_customize_preview() works only in main page?
- page.php is not called when I load a Page
- How to figure out which wordpress theme a site was using?
- Menu order of parent menu from perspective of child menu
- Advantages/Disadvantages Using Theme Editor Instead of Pages
- Magnific Popup – Add Caption to Images
- wp_query – Modify $query to include duplicate content
- Best way to allow for extended use of WordPress functions inside single.php
- Why do WordPress developers use so many opening and closing PHP tags when developing themes? [duplicate]
- Create image with imagepng() (fails at header)
- Mutlisite in wordpress is not working
- Can you create a custom page with content in the center already defined?
- Using WP_Query to re-query and sort results using a date?
- Site loads very slow for archive custom post type page
- Optimising specific Query with ACF meta objects
- How would I get this to work – send to post from thick box
- Data not saved WordPress Custom Admin Page
- Safe way to echo wp_trim_words
- How to get several fields from wp_query?
- Get all Custom Post Types
- Filter URL and shortcodes from the_excerpt
- Changes to template not showing up unless ?reset=1 added to URL
- Check if redirected from a specific page template
- Pagination is not working on custom query inside a custom home page template
- Let users to add any number of input fields in the theme option page
- How to add drop symbol to parent nav items which have child
- Stop Custom post type from being searched via URL
- Postname permalink page not found error
- Loop through multiple custom fields with increasing number