few things here:
1) Your WP_Query args doesn’t look good, the proper way of querying posts by taxonomy should be:
$splash_page_args = array(
'post_type' => 'page',
'posts_per_page' => '3',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'splash-homepage',
),
),
);
2) Is there any particular reason why you’re using foreach
instead of standard WordPress loop? If you want to keep using the foreach loop, then your posts objects are not in $splash_pages
variable, look for them in $splash_pages->posts
.
However, I’d recommend using WordPress loop like so:
if ( $splash_pages->have_posts() ) :
while ( $splash_pages->have_posts() ) : $splash_pages->the_post();
?>
<h2><?php the_title(); ?></h2>
<p><?php the_content(); ?></p>
<?php
endwhile;
endif;
wp_reset_postdata();