WP_Query not able to query multiple post types

Hello there,

For some reason I'll only get the title for one custom post type, or the other and not both as specified in the $args. Any ideas as to why this could be happening?

<?php
$args = array(
  'post_type' => array('post_type_a','post_type_b'));
$the_query = new WP_Query( $args ); ?>

<?php if ( $the_query->have_posts() ) : ?>

	<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
		<h2><?php the_title(); ?</h2>
	<?php endwhile; ?>
	<?php wp_reset_postdata(); ?>

<?php else : ?>
	<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>

Thank you for your help as always :slight_smile: