the_title();
        }
        ?>
</h2>
                  <div class="title-detail-tag"></div>
                                         <?php 
        if (has_post_thumbnail()) {
            $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured');
            $url = $thumb['0'];
            echo '<img src="' . $url . '" />';
        } elseif ('user_listing' == get_post_type($post->ID)) {
            $args = array('order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'attachment', 'post_parent' => $post->ID, 'post_mime_type' => 'image', 'post_status' => null, 'numberposts' => 1);
            $attachments = get_posts($args);
            if ($attachments) {
                foreach ($attachments as $attachment) {
                    arrivals_img($post->ID, 'featured');
                }
            }
        } elseif ('gtcd' == get_post_type($post->ID)) {
            gorilla_img($post->ID, 'featured');
        }
        ?>
                  </a><?php 
    }
    wp_reset_query();
    ?>
  
                        		<?php 
} else {
    ?>
   				
    public function widget($args, $instance)
    {
        $title = isset($instance['title']) ? apply_filters('widget_title', $instance['title']) : '';
        $number = isset($instance['number']) ? apply_filters('widget_number', $instance['number']) : '';
        if (!empty($title)) {
        }
        ?>
<div id="product-list-wrapper-similar" class="hide-for-small">

	<?php 
        echo $args['before_title'] . '<h2>' . $title . '</h2>' . $args['after_title'];
        ?>

		<ul class="tricol-product-list-similar detail-page-product-list">

		<?php 
        global $post;
        wp_reset_query();
        $terms = get_the_terms($post->ID, 'features');
        $do_not_duplicate[] = $post->ID;
        if (!empty($terms)) {
            foreach ($terms as $term) {
                query_posts(array('features' => $term->slug, 'post__not_in' => $do_not_duplicate));
                if (have_posts()) {
                    while (have_posts()) {
                        the_post();
                        $do_not_duplicate[] = $post->ID;
                        ?>
        		
        		<?php 
                        if ($count < $number) {
                            ?>

        		<?php 
                            global $options, $fields, $options2, $options3, $symbols;
                            $fields = get_post_meta($post->ID, 'mod1', true);
                            $options2 = get_post_meta($post->ID, 'mod2', true);
                            $options3 = get_post_meta($post->ID, 'mod3', true);
                            $symbols = get_option('gorilla_symbols');
                            $options = get_option('gorilla_fields');
                            ?>



				<li>

				<div class="image-container">

					<a href="<?php 
                            the_permalink();
                            ?>
">

						<span class="<?php 
                            echo $fields['statustag'];
                            ?>
"></span>

					</a>

					<a href="<?php 
                            the_permalink();
                            ?>
">
					
					<?php 
                            if ('user_listing' == get_post_type($post->ID)) {
                                $args = array('order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'attachment', 'post_parent' => $post->ID, 'post_mime_type' => 'image', 'post_status' => null, 'numberposts' => 1);
                                $attachments = get_posts($args);
                                if ($attachments) {
                                    foreach ($attachments as $attachment) {
                                        arrivals_img($post->ID, 'arrivals');
                                    }
                                }
                            } elseif ('gtcd' == get_post_type($post->ID)) {
                                gorilla_img($post->ID, 'arrivals');
                            }
                            ?>

					</a>

				</div>
				

				 <p><strong><?php 
                            the_title();
                            ?>
</strong>

					<?php 
                            if ($fields['year']) {
                                echo $fields['year'] . ' | ';
                            } else {
                                echo '';
                            }
                            ?>

					<?php 
                            if ($fields['miles']) {
                                echo $fields['miles'] . ' ' . $options['milestext'];
                            } else {
                                echo '';
                            }
                            ?>
<br />

					<span class="price-style"><?php 
                            if (is_numeric($fields['price'])) {
                                echo $symbols['currency'];
                                echo number_format($fields['price']);
                            } else {
                                echo $fields['price'];
                            }
                            ?>
</span></p>

						<p><span class="detail-btn" href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            _e('View', 'language');
                            ?>
</span></p>
						

				</li>
				
				<?php 
                            $count++;
                        }
                        ?>

			<?php 
                    }
                    wp_reset_query();
                }
            }
        }
        ?>

		</ul>

	</div><!--end of content div--><?php 
        echo $args['after_widget'];
    }
				<li class="new-arrivals-list"><a class="arrivals-link" href="<?php 
        the_permalink();
        ?>
"><div class="cpsAjaxLoaderHome">  </div> 
					<div class="image-container">				 
							<div class="<?php 
        echo $fields['statustag'];
        ?>
"></div>					
<?php 
        if ('user_listing' == get_post_type($post->ID)) {
            $args = array('order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'attachment', 'post_parent' => $post->ID, 'post_mime_type' => 'image', 'post_status' => null, 'numberposts' => 1);
            $attachments = get_posts($args);
            if ($attachments) {
                foreach ($attachments as $attachment) {
                    arrivals_img($post->ID, 'arrivals');
                }
            }
        } elseif ('gtcd' == get_post_type($post->ID)) {
            gorilla_img($post->ID, 'arrivals');
        }
        ?>
 
						 
					</div></a>
                    <div class="arrivals-details">
					<p><strong><?php 
        the_title();
        ?>
</strong></p>
					<div class="meta-style"><?php