title: Recent Parse error: syntax error, unexpected 'endif' (T_ENDIF)
body: <p>This bit of code is for displaying related posts and resides in my includes folder.</p>
  
  <p>I have recently switched from a local development environment on a Mac (using MAMP) to using Windows with WAMP. </p>
  
  <p>Suddenly this error is occurring in this block of code. It did not occur on my local Mac environment, nor does it occur when testing live.</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected 'endif' (T_ENDIF)</p>
  </blockquote>
  
  <p>The error specifically points to the second to last <code>endif</code>. If I remove it the same error is thrown pointing to the last <code>endif</code> in the code.</p>
  
  <p>Any ideas? I tried removing both of the specified <code>endif;</code> statements and it throws the following error instead: </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected end of file</p>
  </blockquote>
  
  <pre><code>&lt;?php  
    $orig_post = $post;  
    global $post;  
    $tags = wp_get_post_tags($post-&gt;ID);  
  ?&gt;
  &lt;?php if ($tags):  ?&gt;
  &lt;?php  
    $tag_ids = array();  
    foreach($tags as $individual_tag) $tag_ids[] = $individual_tag-&gt;term_id;  
    $args=array(  
    'tag__in' =&gt; $tag_ids,  
    'post__not_in' =&gt; array($post-&gt;ID),  
    'posts_per_page'=&gt;3, // Number of related posts to display.  
    'caller_get_posts'=&gt;1 ,
    'post_type' =&gt; array( 'post', 'featured-wedding' )
    );  
  
    $my_query = new wp_query( $args );  
  ?&gt;
  &lt;?php if($my_query-&gt;have_posts()): ?&gt;  
      &lt;aside class="related group"&gt;
        &lt;h2&gt;You May Also Like:&lt;/h2&gt;
        &lt;?php while( $my_query-&gt;have_posts() ) : $my_query-&gt;the_post(); ?&gt;
  
          &lt;a href="&lt;? the_permalink()?&gt;"&gt;
              &lt;!-- thumbnail --&gt;
              &lt;?php the_post_thumbnail(array(175,175)); ?&gt;
              &lt;!-- post title --&gt;
              &lt;?php if ( 'featured-wedding' == get_post_type() ) : ?&gt;
                &lt;h1&gt;Featured Wedding: &lt;?php the_title(); ?&gt;&lt;/h1&gt;
              &lt;?php else: ?&gt;
                &lt;h1&gt;&lt;?php the_title(); ?&gt;: &lt;?php if (function_exists('the_subheading')) { the_subheading('&lt;span&gt;', '&lt;/span&gt;'); } ?&gt;&lt;/h1&gt;
              &lt;?php endif; ?&gt;
          &lt;/a&gt;    
  
        &lt;? endwhile; ?&gt;
      &lt;/aside&gt; 
  &lt;?php endif; ?&gt;
  &lt;?php  
    $post = $orig_post;  
    wp_reset_query();  
   ?&gt;  
  
  &lt;?php endif; ?&gt;
  </code></pre>