Hi I am trying to add post from a certain taxonomy term to a cpt loop. The code below is the code I am using.
<?php // Create empty array to store post ids in
$excludes = array();
$args=array(
'post_type' => array ('gallery','videos'),
'taxonomy'=>'series',
'term' => 'pretty-little-liars',
'post_status' => 'publish',
);
$my_query = new WP_Query( $args );
if ($my_query->have_posts()) : while($my_query->have_posts()) : $my_query->the_post(); ?>
But the problem with the code is that all of my post are now missing. I then learned that I needed to add a second loop. Ok so after reading up on WP_Query
I tried to add a second loop but it gave me an error, and here is the code i used for that
<?php // Create empty array to store post ids in
$excludes = array();
$args=array(
'post_type' => array ('gallery','videos'),
'taxonomy'=>'series',
'term' => 'pretty-little-liars',
'post_status' => 'publish',
);
$my_query = new WP_Query( $args );
if ($my_query->have_posts()) : while($my_query->have_posts()) : $my_query->the_post();
// Restore original Query & Post Data
wp_reset_query();
wp_reset_postdata();
/* The 2nd Query (without global var) */
$query2 = new WP_Query( $args2 );
// The 2nd Loop
if ($query2->have_posts()) : while($query2->have_posts()) : $query2->the_post();
// Restore original Query & Post Data
wp_reset_query();
wp_reset_postdata();
?>
It gave me this error
Parse error: syntax error, unexpected $end in /hermes/bosweb/web188/b1885/ipg.celebloidcom1/tvcafe/wp-content/themes/tvcafe/archive-pretty-little-liars.php on line 258
What am I doing wrong here, can anyone help me fix this. I am not going for a seperated structure in my loop but more of a together structure.
For Example I don't want the first loop at the top and the second loop at the bottom. I want them combined in one loop.
If you need more info or would like to see my whole php please let me know.

if():has to be closed, thewhile():too. See syntax. – toscho♦ Jan 4 at 2:03endif;do I add that after eachwp_reset_postdata();....if so i tried that but it didn't work. If i have to add<?php endif; ?>if so that I'm not sure it will work because i have php count codes in my loop as well, were can i upload the whole php file for you to see. – Mihad Aiko Jan 4 at 2:15