<article class="span4"  id="post-<?php 
            the_ID();
            ?>
" <?php 
            post_class($class);
            ?>
><?php 
            $ids = get_metabox('gallery_image_ids');
            $video_embed = get_metabox('format_video_embed');
            $video_url = get_metabox('pretty_video_url');
            if (has_post_thumbnail($post->ID)) {
                if (!empty($video_url) && get_metabox('pretty_video') === 'true') {
                    causes_image($width, $height, true, $video_url);
                } else {
                    causes_image($width, $height);
                }
            } elseif ($ids != "false" && $ids != "") {
                portfolio_gallery($width, $height, $ids);
            } elseif (!empty($video_embed)) {
                echo apply_filters("the_content", htmlspecialchars_decode($video_embed));
            }
            ?>

							<?php 
            if ($format == 'link' || $format == 'quote') {
                ?>

									<div class="loop-block">                    
										<div class="loop-media">
											<div class="loop-format">
 function shortcode_jw_recent_causes($atts, $content)
 {
     global $portAtts;
     $hide_favorites = isset($atts['hide_favorites']) ? $atts['hide_favorites'] : 'false';
     $portAtts = $atts;
     $post_count = isset($atts['post_count']) ? $atts['post_count'] : '';
     $desc_title = !empty($atts['description_title']) ? $atts['description_title'] : '';
     $desc_text = !empty($atts['description_text']) ? $atts['description_text'] : '';
     $port_category_list = isset($atts['port_category_list']) ? $atts['port_category_list'] : '';
     //$arrow = '<div class="carousel-arrow jw-carrow">';
     // $arrow .= '<a class="carousel-prev" href="#"><i class="icon-long-arrow-left"></i></a>';
     //$arrow .= '<a class="carousel-next" href="#"><i class="icon-long-arrow-right"></i></a>';
     //$arrow .= '</div>';
     $output = '';
     if (!empty($desc_text)) {
         $output .= '<div class="row-fluid ">';
         $output .= '<div class="span3 carousel-text jw-title-container">';
         $output .= !empty($desc_title) ? '<div class="jw-title-container"><h3 class="jw-title">' . $desc_title . '</h3><span class="jw-title-border"></span></div>' : '';
         $output .= '<p>' . $desc_text . '</p>';
         $output .= $arrow . '</div>';
         $output .= '<div class="span9">';
     } else {
         $output .= '<div class="carousel-container">';
     }
     $output .= '<div class="jw-carousel-portfolio list_carousel">';
     $output .= '<ul class="jw-carousel">';
     $query = array('post_type' => 'jw_cause', 'posts_per_page' => $post_count);
     $cats = explode(",", $port_category_list);
     if (!empty($cats[0])) {
         $query['tax_query'] = array(array('taxonomy' => 'cat_cause', 'terms' => $cats, 'field' => 'id'));
     }
     if (!empty($atts['order'])) {
         switch ($atts['order']) {
             case "date_asc":
                 $query['orderby'] = 'date';
                 $query['order'] = 'ASC';
                 break;
             case "title_asc":
                 $query['orderby'] = 'title';
                 $query['order'] = 'ASC';
                 break;
             case "title_desc":
                 $query['orderby'] = 'title';
                 $query['order'] = 'DESC';
                 break;
             case "random":
                 $query['orderby'] = 'rand';
                 break;
         }
     }
     $imgwidth = 270;
     // START - LOOP
     query_posts($query);
     while (have_posts()) {
         the_post();
         global $post;
         $imgheight = $atts['image_height'];
         $likeit = get_post_meta($post->ID, 'post_likeit', true);
         $likecount = empty($likeit) ? '0' : $likeit;
         $likedclass = 'likeit';
         if (isset($_COOKIE['likeit-' . $post->ID])) {
             $likedclass .= ' liked';
         }
         $output .= '<li>';
         $ids = get_metabox('gallery_image_ids');
         $video_embed = wp_kses_post(get_metabox('format_video_embed'));
         $video_url = wp_kses_post(get_metabox('pretty_video_url'));
         ob_start();
         if (has_post_thumbnail($post->ID)) {
             if (!empty($video_url) && get_metabox('pretty_video') === 'true') {
                 causes_image($imgwidth, $imgheight, true, $video_url);
             } else {
                 causes_image($imgwidth, $imgheight);
             }
         } elseif ($ids != "false" && $ids != "") {
             portfolio_gallery($imgwidth, $imgheight, $ids);
         } elseif (!empty($video_embed)) {
             echo '<div class="carousel-video">';
             echo apply_filters("the_content", htmlspecialchars_decode($video_embed));
             echo '</div>';
         }
         if (!empty($jw_options['more_text'])) {
             $readMore = $jw_options['more_text'];
         } else {
             $readMore = jw_option('translate_readmore') ? jw_option('translate_readmore') : __('Read More', 'designinvento');
         }
         $output .= ob_get_clean();
         $output .= '<div class="image-content">';
         $output .= '<div class="portfolio-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></div>';
         $output .= '<div class="progress home-progress">';
         $output .= '<div class="progress-bar" role="progressbar" aria-valuenow="' . get_metabox('client_name') . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . get_metabox('client_name') . '" " >' . get_metabox('client_name') . '';
         $output .= '</div>';
         $output .= '</div>';
         $output .= '<div class=""><h5><span>' . get_metabox('client_name') . ' Donated  /</span>  ' . get_metabox('project_date') . ' To Go</h5></div>';
         $output .= '<div class="main-page-causes"><p>' . wp_trim_words(get_the_content(), 15) . '</p></div>';
         $output .= '<div class="cause-read"><a href="' . get_permalink() . '">' . $readMore . '</a><a href="' . get_metabox('cause_donate') . '" target="_blank">Donate Now</a></div>';
         $output .= '</div>';
         $output .= '</li>';
     }
     wp_reset_query();
     // END   - LOOP
     $output .= '</ul>';
     $output .= '<div class="clearfix"></div>';
     if (empty($desc_text)) {
         $output .= $arrow;
     }
     $output .= '</div>';
     if (!empty($desc_text)) {
         $output .= '</div>';
     }
     $output .= '</div>';
     return $output;
 }