<?php if (!empty($posts)): ?>
    <ul class="games_list">
        <?php foreach ($posts as $post) : ?>
            <?php
            $featured_image_width = 150;
            $featured_image_height = 120;
            $permalink = get_permalink($post->ID);
            $terms = wp_get_post_terms($post->ID, 'cons');
            $featured_image = "";
            if (has_post_thumbnail($post->ID)) {
                $featured_image = ThemeMakersHelper::get_post_featured_image($post->ID, 'gallery_thumb');
            }
            ?>

            <li class="game_id_<?php echo $post->ID ?>">
							
                <div class="caption">
				                                      
					<span><?php echo $post->post_title ?></span>                  
					                    
						<?php if (!empty($terms)): ?>
                            
							<?php foreach ($terms as $term) : ?>
                                
								<?php $cons_color = get_taxonomy_term_type('cons', $term->term_id); ?>
					
									<span><?php echo "(".$term->name.")" ?></span>
                                														
								<?php endforeach; ?>
						
                        <?php endif; ?>
						                   
					
					<button type="button" class="remove_from_my_games button yellow small" game_id="<?php echo $post->ID ?>">Remove this game</button>                
					<button type="button" class="add_to_my_games button yellow small" game_id="<?php echo $post->ID ?>">Add to games I play</button>
					
				</div><!--/ .caption-->
				
                <div class="clear"></div>
				
                <input type="hidden" name="my_games[<?php echo $post->ID ?>]" value="<?php echo $post->ID ?>" />
           
			</li>

        <?php endforeach; ?>
    </ul>
<?php endif; ?>
