<?php if (!empty($posts_ids)): ?>
    <ul>
        <?php foreach ($posts_ids as $post_id) : ?>
            <?php
            $featured_image_width = 313;
            $featured_image_height = 220;
            $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>
                <input type="button" value="Add to features" class="add_to_features_button" /><br />
                <a href="<?php echo $permalink ?>" target="_blank">
                    <img src="<?php echo $featured_image ?>" width="<?php echo $featured_image_width ?>" height="<?php echo $featured_image_height ?>" alt="" />
                </a>

                <div class="caption">
                    <span class="date"><?php echo $post->post_date ?></span>
                    <h5 class="title"><a href="<?php echo $permalink ?>"><?php echo $post->post_title ?></a></h5>
                    <div class="description"><?php echo $post->post_excerpt ?></div>
                    <div class="platform-teaser">
                        <?php if (!empty($terms)): ?>
                            <?php foreach ($terms as $term) : ?>
                                <?php $cons_color = get_taxonomy_term_type('cons', $term->term_id); ?>
                                <a style="background-color: <?php echo $cons_color ?>" class="game_console" href="<?php bloginfo('url') ?>/?cons=<?php echo $term->slug ?>"><?php echo $term->name ?></a>
                            <?php endforeach; ?>
                        <?php endif; ?>
                    </div><!--/ .platform-teaser-->
                </div><!--/ .caption-->
                <div class="clear"></div>
                <input type="hidden" name="featured_games[]" value="<?php echo $post->ID ?>" />
            </li>

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