Receiving T_String parse error when adding custom post type to loop

I’ve registered a custom post type, and that works without issue. My code to register is:

add_action( 'init', 'hvac_products' );

function hvac_products() {

register_post_type( 'hvac-products',
	  'labels' => array(
		'name' => 'HVAC Products',
		'singular_name' => 'HVAC Product',
	  'description' => 'Add products to your main products page.',
	  'public' => true,
	  'menu_position' => 20,
	  'supports' => array( 'title', 'editor',)

Now that I’ve added a post, I’m trying to loop it into a custom template, and it is throwing a parse error. The code I’m using in my custom template is this:


 $loop = new WP_Query( array( 'post_type' => 'hvac-products', 'posts_per_page' => 10 ) );
 while ( $loop->have_posts() ) : $loop->the_post();

	 echo '<div class="products-container">';
		 echo '<div class="products-image">';
		 echo '<img src="';
		 echo '" alt="<?php the_title();" ?></a></div>';
		 echo '<div class="products-text">';
			 echo '<h2 class="product-title">';
			 echo '</h2>';

			 echo '</div>';

		 echo '</div>';

	 echo '</div>';

	  echo '<div class="clear"></div>';



I’ve attached a screen shot of the parse error. This is a fresh WP 3.6 install with the latest Roots. The only plugins I have active are ACF and Contact Form 7.

Any help greatly appreciated!

Dang - sorry everyone. After posting I finally figured it out, but it still doesn’t make sense to me.

I open with <? but it wanted <?php.

However, I have another Wordpress 3.6 site posting CPTs and beginning the loop with <? and they are working fine. So I’m at a loss as to what the difference is.

This will be host and hosting account specific, whether short php tags is activated. It’s a good idea to just use the full tag all the time to be compatible with all hosts.

Oh gotcha, that makes sense. Great to know - thanks Chris.