<article <?php 
    post_class();
    ?>
 id="post-<?php 
    the_ID();
    ?>
">
		<header>       
			<h2 class="entry-title"><?php 
    the_title();
    ?>
&nbsp;<?php 
    $year = get_post_meta($post->ID, 'movie_year', true);
    echo !empty($year) ? "({$year})" : "";
    if (!get_option("adelante_post_featured_image")) {
        adelante_featured_image(40, 40, null, "gallery-item alignright");
    }
    ?>
</h2>
			<?php 
    adelante_post_meta();
    ?>
  
			<?php 
    if (get_option('adelante_post_author') == 'checked') {
        ?>
			<p class="byline author vcard">
				Written by <span class="fn"><?php 
        the_author();
        ?>
</span>
      
        <li style="width: <?php 
        echo $width;
        ?>
px;" id="post-<?php 
        the_ID();
        ?>
" data-id="post-<?php 
        the_ID();
        ?>
" <?php 
        echo post_class(array(implode(" ", $postTerms)));
        ?>
>           
            <?php 
        adelante_featured_image($height, $width);
        ?>
                                                             
            <h3 class="blog_header"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>            

            <div class="entry-content">
                <?php 
        the_excerpt();
        ?>
            </div>
"><?php 
        the_title();
        ?>
</a></h2>            
            </header>
            
            <div class="entry-content">
                <?php 
        if ($fi_position == 'left' && !$fi_disabled) {
            adelante_featured_image(200, 200, null, "gallery-item alignedleft");
        }
        ?>
                        
                <?php 
        if ($fi_position == 'right' && !$fi_disabled) {
            adelante_featured_image(200, 200, null, "gallery-item alignedright");
        }
        ?>
                <?php 
        the_excerpt();
        ?>
            </div>
                                        
        </article>        

        <?php 
        $counter++;
        ?>
         
        <?php 
    }
    function adelante_blog($atts, $content = null)
    {
        global $wp_filter;
        $the_content_filter_backup = $wp_filter['the_content'];
        extract(shortcode_atts(array('count' => 3, 'cat' => '', 'image' => 'true', 'meta' => 'true', 'full' => 'false', 'height' => 218, 'width' => 576, 'posttype' => 'post'), $atts));
        $query = array('posts_per_page' => (int) $count, 'post_type' => $posttype);
        if ($cat) {
            $query['cat'] = $cat;
        }
        $query['showposts'] = $count;
        ob_start();
        $r = new WP_Query($query);
        if ($r->have_posts()) {
            while ($r->have_posts()) {
                $r->the_post();
                ?>
                <article id="post-<?php 
                the_ID();
                ?>
" <?php 
                post_class();
                ?>
>  
                    <?php 
                $fi_position = get_post_meta($r->post->ID, 'featured_image_position', true);
                ?>
                 
                    <header>
                        <?php 
                if ($image == 'true' && ($fi_position == "top" || $fi_position == "")) {
                    adelante_featured_image((int) $height, (int) $width);
                }
                ?>
                        <h2 class="blog_header clearboth"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
                        <?php 
                if ($meta == 'true') {
                    adelante_post_meta();
                }
                ?>
                
                    </header> 
                    <div class="entry-content">
                        <?php 
                if ($fi_position == 'left') {
                    adelante_featured_image(200, 200, null, "gallery-item alignedleft");
                }
                ?>
                        
                        <?php 
                if ($fi_position == 'right') {
                    adelante_featured_image(200, 200, null, "gallery-item alignedright");
                }
                ?>
   
                        <?php 
                if ($full == 'true') {
                    ?>
                                <?php 
                    the_content('Continue&hellip;');
                    ?>
                        <?php 
                } else {
                    ?>
                                <?php 
                    the_excerpt();
                    ?>
                        <?php 
                }
                ?>
                    </div>                   
                </article>
    <?php 
            }
        }
        $output = ob_get_contents();
        ob_end_clean();
        wp_reset_postdata();
        $wp_filter['the_content'] = $the_content_filter_backup;
        return '[raw]' . $output . '[/raw]';
    }