Пример #1
0
 protected function content($atts, $content = null)
 {
     $title = $category = $item_class = $width = $hover_style = $gutters = $fullwidth = $list_class = $el_class = $output = $filter = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', "item_count" => '12', 'item_columns' => '4', 'fullwidth' => 'no', 'gutters' => 'yes', "category" => 'all', 'hover_style' => 'default', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     /* SIDEBAR CONFIG
        ================================================== */
     global $sf_sidebar_config, $sf_options;
     $sidebars = '';
     if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sf_sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     if (is_singular('portfolio')) {
         $sidebars = "no-sidebars";
     }
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     global $post, $wp_query, $sf_carouselID;
     if ($sf_carouselID == "") {
         $sf_carouselID = 1;
     } else {
         $sf_carouselID++;
     }
     $categories = explode(",", $category_slug);
     $translated_categories = '';
     foreach ($categories as $key => $category_slug) {
         $category_id_by_slug = get_term_by('slug', $category_slug, 'portfolio-category');
         if (isset($category_id_by_slug->term_id)) {
             $translated_slug_id = apply_filters('wpml_object_id', $category_id_by_slug->term_id, 'custom taxonomy', true);
             $translated_slug = get_term_by('id', $translated_slug_id, 'portfolio-category');
             $translated_categories = $translated_categories . ($key < count($categories) - 1 ? $translated_slug->slug . ',' : $translated_slug->slug);
         }
     }
     $portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'portfolio-category' => $translated_categories, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
     $portfolio_items = new WP_Query($portfolio_args);
     $count = 0;
     $figure_width = 300;
     $figure_height = 225;
     if ($item_columns == "3") {
         $figure_width = 400;
         $figure_height = 300;
     }
     if ($item_columns == "2") {
         $figure_width = 600;
         $figure_height = 450;
     }
     // Thumb Type
     if ($hover_style == "default" && function_exists('sf_get_thumb_type')) {
         $list_class = sf_get_thumb_type();
     } else {
         $list_class = 'thumbnail-' . $hover_style;
     }
     if ($gutters == "no") {
         $list_class .= ' no-gutters';
     } else {
         $list_class .= ' gutters';
     }
     $portfolio_carousel_item_class = apply_filters('spb_portfolio_carousel_item_class', '');
     $items .= '<div id="carousel-' . $sf_carouselID . '" class="portfolio-items carousel-items clearfix ' . $list_class . '" data-columns="' . $item_columns . '" data-auto="false">';
     while ($portfolio_items->have_posts()) {
         $portfolio_items->the_post();
         $items .= '<div itemscope data-id="id-' . $count . '" class="clearfix carousel-item portfolio-item ' . $portfolio_carousel_item_class . '">';
         $items .= sf_portfolio_thumbnail("gallery", "", "1/1", $item_columns, "no", 0, $gutters, $fullwidth);
         $items .= '</div>';
         $count++;
     }
     wp_reset_postdata();
     $items .= '</div>';
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_portfolio_carousel_widget carousel-asset spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     if ($fullwidth == "yes") {
         $output .= "\n\t\t" . '<div class="title-wrap container clearfix">';
     } else {
         $output .= "\n\t\t" . '<div class="title-wrap clearfix">';
     }
     if ($title != '') {
         $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
     }
     $output .= spb_carousel_arrows();
     $output .= '</div>';
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_include_carousel, $sf_include_isotope;
     $sf_include_carousel = true;
     $sf_include_isotope = true;
     return $output;
 }
 public function content($atts, $content = null)
 {
     $title = $order = $page_link = $items = $item_class = $el_class = $width = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'order' => '', 'category' => 'all', 'pagination' => 'no', 'page_link' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts));
     $output = '';
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     // TESTIMONIAL QUERY SETUP
     global $post, $wp_query, $sf_carouselID;
     if ($sf_carouselID == "") {
         $sf_carouselID = 1;
     } else {
         $sf_carouselID++;
     }
     $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $testimonials_args = array('orderby' => $order, 'post_type' => 'testimonials', 'post_status' => 'publish', 'paged' => $paged, 'testimonials-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
     $testimonials = new WP_Query($testimonials_args);
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     $items .= '<div id="carousel-' . $sf_carouselID . '" class="testimonials carousel-items clearfix" data-columns="1" data-auto="false">';
     // TESTIMONIAL LOOP
     while ($testimonials->have_posts()) {
         $testimonials->the_post();
         $testimonial_text = get_the_content();
         $testimonial_cite = sf_get_post_meta($post->ID, 'sf_testimonial_cite', true);
         $testimonial_cite_subtext = sf_get_post_meta($post->ID, 'sf_testimonial_cite_subtext', true);
         $testimonial_image = rwmb_meta('sf_testimonial_cite_image', 'type=image', $post->ID);
         foreach ($testimonial_image as $detail_image) {
             $testimonial_image_url = $detail_image['url'];
             break;
         }
         if (!$testimonial_image) {
             $testimonial_image = get_post_thumbnail_id();
             $testimonial_image_url = wp_get_attachment_url($testimonial_image, 'full');
         }
         $testimonial_image = sf_aq_resize($testimonial_image_url, 70, 70, true, false);
         $items .= '<li class="testimonial carousel-item col-sm-12 clearfix">';
         $items .= '<div class="testimonial-text">' . do_shortcode($testimonial_text) . '</div>';
         $items .= '<div class="testimonial-cite">';
         if ($testimonial_image) {
             $items .= '<img src="' . $testimonial_image[0] . '" width="' . $testimonial_image[1] . '" height="' . $testimonial_image[2] . '" alt="' . $testimonial_cite . '" />';
             $items .= '<div class="cite-text has-cite-image"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>';
         } else {
             $items .= '<div class="cite-text"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>';
         }
         $items .= '</div>';
         $items .= '</li>';
     }
     wp_reset_query();
     wp_reset_postdata();
     $items .= '</div>';
     if ($page_link == "yes") {
         global $sf_options;
         $testimonials_page = __($sf_options['testimonial_page'], 'swift-framework-plugin');
         if ($testimonials_page) {
             $items .= '<a href="' . get_permalink($testimonials_page) . '" class="read-more">' . __("More", 'swift-framework-plugin') . '<i class="ssnavigate-right"></i></a>';
         }
     }
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $el_class .= ' testimonial';
     $output .= "\n\t" . '<div class="spb_testimonial_carousel_widget carousel-asset spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= "\n\t\t" . '<div class="title-wrap clearfix">';
     if ($title != '') {
         $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
     }
     $output .= spb_carousel_arrows();
     $output .= '</div>';
     $output .= "\n\t\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $sf_include_carousel, $sf_include_isotope;
     $sf_include_carousel = true;
     $sf_include_isotope = true;
     return $output;
 }
Пример #3
0
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $output = $filter = $social_icon_type = $items = $team_member_link_class = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'item_columns' => '3', 'display_type' => 'standard', 'carousel' => 'no', "item_count" => '12', "custom_image_height" => '', "category" => '', 'pagination' => '', 'post_ids' => '', 'profile_link' => 'yes', 'ajax_overlay' => 'no', 'fullwidth' => 'no', 'gutters' => 'yes', 'order' => 'desc', 'order_by' => 'date', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     $contact_icon = apply_filters('sf_mail_icon', '<i class="ss-mail"></i>');
     $phone_icon = apply_filters('sf_phone_icon', '<i class="ss-phone"></i>');
     /* SIDEBAR CONFIG
        ================================================== */
     global $sf_sidebar_config;
     $sidebars = '';
     if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sf_sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     global $post, $wp_query;
     $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $team_args = array('post_type' => 'team', 'post_status' => 'publish', 'paged' => $paged, 'team-category' => $category_slug, 'posts_per_page' => $item_count, 'order' => $order, 'orderby' => $order_by, 'ignore_sticky_posts' => 1);
     if ($post_ids != "") {
         $team_args['post__in'] = array($post_ids);
     }
     $team_members = new WP_Query($team_args);
     $count = 0;
     $image_width = 270;
     $image_height = 270;
     if ($item_columns == "1") {
         $item_class = 'col-sm-12';
     } else {
         if ($item_columns == "2") {
             $image_width = 540;
             $image_height = 540;
             $item_class = 'col-sm-6';
         } else {
             if ($item_columns == "3") {
                 $image_width = 360;
                 $image_height = 360;
                 $item_class = 'col-sm-4';
             } else {
                 if ($item_columns == "5") {
                     $image_width = 360;
                     $image_height = 360;
                     $item_class = 'col-sm-sf-5';
                 } else {
                     $item_class = 'col-sm-3';
                 }
             }
         }
     }
     if ($custom_image_height != "") {
         $image_height = $custom_image_height;
     }
     $list_class = 'display-type-' . $display_type;
     if ($ajax_overlay == "yes") {
         $team_member_link_class = 'team-member-ajax';
     }
     if ($gutters == "no") {
         $list_class .= ' no-gutters';
     }
     if ($carousel == "yes") {
         global $sf_carouselID;
         if ($sf_carouselID == "") {
             $sf_carouselID = 1;
         } else {
             $sf_carouselID++;
         }
         $item_class = 'carousel-item';
         $items .= '<div class="team-carousel carousel-wrap"><div id="carousel-' . $sf_carouselID . '" class="team-members carousel-items ' . $list_class . ' clearfix" data-columns="' . $item_columns . '" data-auto="false">';
     } else {
         $items .= '<div class="team-members ' . $list_class . ' row clearfix">';
     }
     while ($team_members->have_posts()) {
         $team_members->the_post();
         $postID = $post->ID;
         $member_name = get_the_title();
         $member_position = sf_get_post_meta($postID, 'sf_team_member_position', true);
         $custom_excerpt = sf_get_post_meta($postID, 'sf_custom_excerpt', true);
         $pb_active = get_post_meta($postID, '_spb_js_status', true);
         $member_link = get_permalink($postID);
         $member_bio = "";
         if ($pb_active == "true") {
             if ($custom_excerpt != "") {
                 $member_bio = $custom_excerpt;
             } else {
                 $member_bio = get_the_excerpt();
             }
         } else {
             if ($custom_excerpt != "") {
                 $member_bio = sf_custom_excerpt($custom_excerpt, 1000);
             } else {
                 $member_bio = apply_filters('the_content', get_the_content(''));
             }
         }
         $member_email = sf_get_post_meta($postID, 'sf_team_member_email', true);
         $member_phone = sf_get_post_meta($postID, 'sf_team_member_phone_number', true);
         $member_twitter = sf_get_post_meta($postID, 'sf_team_member_twitter', true);
         $member_facebook = sf_get_post_meta($postID, 'sf_team_member_facebook', true);
         $member_linkedin = sf_get_post_meta($postID, 'sf_team_member_linkedin', true);
         $member_google_plus = sf_get_post_meta($postID, 'sf_team_member_google_plus', true);
         $member_skype = sf_get_post_meta($postID, 'sf_team_member_skype', true);
         $member_instagram = sf_get_post_meta($postID, 'sf_team_member_instagram', true);
         $member_dribbble = sf_get_post_meta($postID, 'sf_team_member_dribbble', true);
         $view_profile_text = __("View Profile", 'swift-framework-plugin');
         $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
         $item_icon = apply_filters('sf_team_hover_icon', "fa-pencil");
         $item_svg_icon = apply_filters('sf_team_hover_svg_icon', "");
         $thumb_img_url = "";
         foreach ($thumb_image as $detail_image) {
             $thumb_image_id = $detail_image['ID'];
             $thumb_img_url = $detail_image['url'];
             break;
         }
         if (!$thumb_image) {
             $thumb_image = get_post_thumbnail_id();
             $thumb_image_id = $thumb_image;
             $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
         }
         $image = sf_aq_resize($thumb_img_url, $image_width, $image_height, true, false);
         // Output
         $items .= '<div itemscope data-id="id-' . $count . '" class="clearfix team-member ' . $item_class . '">';
         if (sf_theme_supports('minimal-team-hover')) {
             $items .= '<div class="team-member-item-wrap">';
         }
         $items .= '<figure class="animated-overlay">';
         if (sf_theme_supports('minimal-team-hover') && $display_type != "gallery") {
             $items .= '<a class="team-member-link ' . $team_member_link_class . '" href="' . get_permalink() . '" data-id="' . $postID . '"></a>';
         }
         if ($display_type == "gallery") {
             $items .= '<a class="team-gallery-mobile-link" href="' . get_permalink() . '" class="' . $team_member_link_class . '" data-id="' . $postID . '"></a>';
         }
         if ($image) {
             $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $member_name . '" />';
         }
         $items .= '<figcaption class="team-' . $display_type . '">';
         if (sf_theme_supports('minimal-team-hover') && $display_type != "gallery") {
             $items .= '<div class="thumb-info thumb-info-alt">';
             if ($item_svg_icon != "") {
                 $items .= $item_svg_icon;
             } else {
                 $items .= '<i class="' . $item_icon . '"></i>';
             }
             $items .= '</div>';
         } else {
             $items .= '<div class="thumb-info">';
             if ($display_type == "gallery") {
                 if ($profile_link == "yes") {
                     $items .= '<h4 class="team-member-name"><a href="' . get_permalink() . '" class="' . $team_member_link_class . '" data-id="' . $postID . '">' . $member_name . '</a></h4>';
                 } else {
                     $items .= '<h4 class="team-member-name">' . $member_name . '</h4>';
                 }
                 $items .= '<h5 class="team-member-position">' . $member_position . '</h5>';
                 $items .= '<div class="name-divide"></div>';
             }
             if ($member_twitter || $member_facebook || $member_linkedin || $member_google_plus || $member_skype || $member_instagram || $member_dribbble) {
                 $items .= '<ul class="social-icons">';
                 if ($member_twitter) {
                     $items .= '<li class="twitter"><a href="http://www.twitter.com/' . $member_twitter . '" target="_blank"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></li>';
                 }
                 if ($member_facebook) {
                     $items .= '<li class="facebook"><a href="' . $member_facebook . '" target="_blank"><i class="fa-facebook"></i><i class="fa-facebook"></i></a></li>';
                 }
                 if ($member_linkedin) {
                     $items .= '<li class="linkedin"><a href="' . $member_linkedin . '" target="_blank"><i class="fa-linkedin"></i><i class="fa-linkedin"></i></a></li>';
                 }
                 if ($member_google_plus) {
                     $items .= '<li class="googleplus"><a href="' . $member_google_plus . '" target="_blank"><i class="fa-google-plus"></i><i class="fa-google-plus"></i></a></li>';
                 }
                 if ($member_skype) {
                     $items .= '<li class="skype"><a href="skype:' . $member_skype . '" target="_blank"><i class="fa-skype"></i><i class="fa-skype"></i></a></li>';
                 }
                 if ($member_instagram) {
                     $items .= '<li class="instagram"><a href="' . $member_instagram . '" target="_blank"><i class="fa-instagram"></i><i class="fa-instagram"></i></a></li>';
                 }
                 if ($member_dribbble) {
                     $items .= '<li class="dribbble"><a href="http://www.dribbble.com/' . $member_dribbble . '" target="_blank"><i class="fa-dribbble"></i><i class="fa-dribbble"></i></a></li>';
                 }
                 $items .= '</ul>';
             }
             if ($display_type != "gallery" && $profile_link == "yes") {
                 $items .= '<a class="view-profile ' . $team_member_link_class . '" href="' . $member_link . '" data-id="' . $postID . '">' . $view_profile_text . '</a>';
             }
             $items .= '</div>';
         }
         $items .= '</figcaption>';
         $items .= '</figure>';
         if (sf_theme_supports('minimal-team-hover')) {
             $items .= '<div class="team-member-details-wrap">';
         }
         if ($display_type != "gallery") {
             if ($profile_link == "yes") {
                 $items .= '<h4 class="team-member-name"><a href="' . get_permalink() . '" class="' . $team_member_link_class . '" data-id="' . $postID . '">' . $member_name . '</a></h4>';
             } else {
                 $items .= '<h4 class="team-member-name">' . $member_name . '</h4>';
             }
             $items .= '<h5 class="team-member-position">' . $member_position . '</h5>';
         }
         if ($display_type == "standard") {
             if (sf_theme_supports('minimal-team-hover')) {
                 $items .= '<div class="team-member-divider"></div>';
             }
             if ($profile_link == "yes") {
                 $items .= '<div class="team-member-bio">' . $member_bio . '<a href="' . get_permalink() . '" class="read-more ' . $team_member_link_class . '" data-id="' . $postID . '">' . $view_profile_text . '</a></div>';
             } else {
                 $items .= '<div class="team-member-bio">' . $member_bio . '</div>';
                 $items .= '<ul class="member-contact">';
                 if ($member_email) {
                     $items .= '<li>' . $contact_icon . '<span itemscope="email"><a href="mailto:' . $member_email . '">' . $member_email . '</a></span></li>';
                 }
                 if ($member_phone) {
                     $items .= '<li>' . $phone_icon . '<span itemscope="telephone">' . $member_phone . '</span></li>';
                 }
                 $items .= '</ul>';
             }
         }
         if (sf_theme_supports('minimal-team-hover')) {
             $items .= '</div>';
             $items .= '</div>';
         }
         $items .= '</div>';
         $count++;
     }
     wp_reset_postdata();
     if ($carousel == "yes") {
         $items .= '</div></div>';
     } else {
         $items .= '</div>';
     }
     // PAGINATION
     if ($pagination == "yes" && $carousel == "no") {
         $items .= '<div class="pagination-wrap">';
         $items .= pagenavi($team_members);
         $items .= '</div>';
     }
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $output .= "\n\t" . '<div class="team_list carousel-asset spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $output .= "\n\t\t" . '<div class="title-wrap container">';
         if ($title != '') {
             $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
         }
         if ($carousel == "yes") {
             $output .= spb_carousel_arrows();
         }
         $output .= '</div>';
     } else {
         $output .= "\n\t\t" . '<div class="title-wrap clearfix">';
         if ($title != '') {
             $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
         }
         if ($carousel == "yes") {
             $output .= spb_carousel_arrows();
         }
         $output .= '</div>';
     }
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_include_isotope, $sf_has_team, $sf_include_carousel;
     $sf_include_isotope = true;
     $sf_has_team = true;
     if ($carousel == "yes") {
         $sf_include_carousel = true;
     }
     return $output;
 }
Пример #4
0
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $carousel = $item_class = $output = $tax_terms = $filter = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'item_columns' => '4', 'category' => '', 'carousel' => 'no', 'carousel_columns' => '', 'pagination' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     // CLIENTS QUERY SETUP
     global $post, $wp_query, $sf_carouselID;
     if ($sf_carouselID == "") {
         $sf_carouselID = 1;
     } else {
         $sf_carouselID++;
     }
     $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $client_args = array('post_type' => 'clients', 'post_status' => 'publish', 'paged' => $paged, 'clients-category' => $category_slug, 'posts_per_page' => $item_count);
     $clients_items = new WP_Query($client_args);
     global $column_width;
     $client_width = 300;
     $client_height = 300;
     if ($item_columns == "5") {
         $item_class = 'col-sm-sf-5';
     } else {
         if ($item_columns == "4") {
             $item_class = 'col-sm-3';
         } else {
             if ($item_columns == "3") {
                 $item_class = 'col-sm-4';
                 $client_width = 400;
                 $client_height = 400;
             }
         }
     }
     if ($item_columns == "2") {
         $item_class = 'col-sm-6';
         $client_width = 600;
         $client_height = 600;
     }
     if ($carousel == "yes") {
         $items .= '<div id="carousel-' . $sf_carouselID . '" class="clients-items carousel-items clearfix" data-columns="' . $item_columns . '">';
     } else {
         $items .= '<div class="clients-items row clearfix">';
     }
     // CLIENTS LOOP
     while ($clients_items->have_posts()) {
         $clients_items->the_post();
         $client_image = get_post_thumbnail_id();
         $client_img_url = wp_get_attachment_url($client_image, 'full');
         $client_link_url = sf_get_post_meta($post->ID, 'sf_client_link', true);
         $image_alt = esc_attr(sf_get_post_meta($client_image, '_wp_attachment_image_alt', true));
         if ($carousel == "yes") {
             $items .= '<div class="clearfix carousel-item">';
         } else {
             $items .= '<div class="' . $item_class . ' client-item clearfix">';
         }
         $items .= '<figure>';
         $image = sf_aq_resize($client_img_url, $client_width, $client_height, true, false);
         if ($image) {
             if ($client_link_url) {
                 $items .= '<a href="' . $client_link_url . '" target="_blank"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" /></a>';
             } else {
                 $items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" />';
             }
         }
         $items .= '</figure>';
         $items .= '</div>';
     }
     wp_reset_query();
     wp_reset_postdata();
     $items .= '</div>';
     // PAGINATION
     if ($pagination == "yes") {
         $items .= '<div class="pagination-wrap">';
         $items .= pagenavi($clients_items);
         $items .= '</div>';
     }
     // PAGE BUILDER OUPUT
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $output .= "\n\t" . '<div class="spb_clients_widget clients-wrap carousel-asset spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= "\n\t\t" . '<div class="title-wrap clearfix">';
     if ($title != '') {
         $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
     }
     if ($carousel == "yes") {
         $output .= spb_carousel_arrows();
     }
     $output .= '</div>';
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $sf_include_carousel;
     $sf_include_carousel = true;
     return $output;
 }
Пример #5
0
 protected function content($atts, $content = null)
 {
     $title = $asset_type = $carousel = $width = $sidebars = $el_class = $output = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'asset_type' => 'best-sellers', 'category' => '', 'products' => '', 'display_type' => '', 'display_layout' => '', 'carousel' => 'no', 'multi_masonry' => 'no', 'fullwidth' => 'no', 'gutters' => 'yes', 'columns' => '4', 'item_count' => '8', 'order_by' => '', 'order' => '', 'button_enabled' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     if (isset($atts['display_layout']) && $atts['display_layout'] == "grid") {
         $atts['display_layout'] = "standard";
     }
     $view_all_icon = apply_filters('sf_view_all_icon', '<i class="ss-layergroup"></i>');
     /* SIDEBAR CONFIG
        ================================================== */
     global $sf_sidebar_config;
     $sidebars = '';
     if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sf_sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     /* PRODUCT ITEMS
        ================================================== */
     if ($asset_type == "categories") {
         $atts['multi_masonry'] = "no";
     }
     if (sf_woocommerce_activated()) {
         $items = sf_product_items($atts);
     } else {
         $items = __("Please install/activate WooCommerce.", 'swift-framework-plugin');
     }
     /* OUTPUT
        ================================================== */
     global $sf_product_display_layout;
     if ($display_layout != "") {
         $sf_product_display_layout = $display_layout;
     }
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $page_button = $title_wrap_class = "";
     $has_button = true;
     $shop_page_url = get_permalink(wc_get_page_id('shop'));
     $page_button = '<a class="sf-button medium white sf-icon-stroke " href="' . $shop_page_url . '">' . $view_all_icon . '<span class="text">' . __("VIEW ALL PRODUCTS", 'swift-framework-plugin') . '</span></a>';
     if ($has_button && $button_enabled == "yes") {
         $title_wrap_class .= 'has-button ';
     }
     if ($fullwidth == "yes" && $sidebars == "no-sidebars" && $width == "col-sm-12") {
         $title_wrap_class .= 'container ';
     }
     $output .= "\n\t" . '<div class="product_list_widget woocommerce spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= "\n\t\t" . '<div class="title-wrap clearfix ' . $title_wrap_class . '">';
     if ($title != '') {
         if ($fullwidth == "yes") {
             $output .= '<h2 class="spb-heading"><span>' . $title . '</span></h2>';
         } else {
             $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
         }
     }
     if ($carousel == "yes") {
         $output .= spb_carousel_arrows();
     }
     if ($has_button && $button_enabled == "yes") {
         $output .= $page_button;
     }
     $output .= '</div>';
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth == "yes" && $sidebars == "no-sidebars" && $width == "col-sm-12") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     if ($carousel == "yes") {
         global $sf_include_carousel;
         $sf_include_carousel = true;
     }
     global $sf_include_isotope, $sf_has_products;
     $sf_include_isotope = true;
     $sf_has_products = true;
     return $output;
 }
Пример #6
0
 protected function content($atts, $content = null)
 {
     global $sf_options;
     $title = $category = $wrap_class = $title_class = $item_class = $width = $el_class = $output = $filter = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', "item_count" => '5', "category" => 'all', 'pagination' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $pagination_view_icon = apply_filters('sf_pagination_view_icon', '<i class="sf-icon-quickview"></i>');
     // TYPE CHECK
     $alt_display = false;
     if (sf_theme_supports('spb-port-showcase-alt')) {
         $alt_display = true;
     }
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     global $post, $wp_query;
     $categories = explode(",", $category_slug);
     $translated_categories = '';
     foreach ($categories as $key => $category_slug) {
         $category_id_by_slug = get_term_by('slug', $category_slug, 'portfolio-category');
         if (isset($category_id_by_slug->term_id)) {
             $translated_slug_id = apply_filters('wpml_object_id', $category_id_by_slug->term_id, 'custom taxonomy', true);
             $translated_slug = get_term_by('id', $translated_slug_id, 'portfolio-category');
             $translated_categories = $translated_categories . ($key < count($categories) - 1 ? $translated_slug->slug . ',' : $translated_slug->slug);
         }
     }
     $portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'portfolio-category' => $translated_categories, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
     $portfolio_items = new WP_Query($portfolio_args);
     // OUTPUT
     if ($alt_display == "yes") {
         if ($pagination == "yes") {
             $wrap_class = "has-pagination ";
         }
         $title_class = "center-title";
         global $sf_carouselID;
         if ($sf_carouselID == "") {
             $sf_carouselID = 1;
         } else {
             $sf_carouselID++;
         }
         $items .= '<div class="port-carousel carousel-wrap">';
         $items .= spb_carousel_arrows(true);
         $items .= '<div id="carousel-' . $sf_carouselID . '" class="portfolio-showcase carousel-items staged-carousel gutters clearfix" data-columns="5" data-auto="false" data-pagination="' . $pagination . '">';
     } else {
         $items .= '<div class="portfolio-showcase-wrap"><ul class="portfolio-showcase-items clearfix" data-columns="' . $item_count . '">';
     }
     while ($portfolio_items->have_posts()) {
         $portfolio_items->the_post();
         if ($alt_display) {
             $items .= '<div itemscope class="clearfix carousel-item portfolio-item gallery-item">';
             $items .= sf_portfolio_thumbnail("gallery", "", "1/1", '3', "no", 0, "yes", "yes");
             $items .= '</div>';
         } else {
             $thumb_img_url = "";
             $item_title = get_the_title();
             $item_subtitle = sf_get_post_meta($post->ID, 'sf_portfolio_subtitle', true);
             $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
             foreach ($thumb_image as $detail_image) {
                 $thumb_img_url = $detail_image['url'];
                 break;
             }
             if (!$thumb_image || $thumb_img_url == "") {
                 $thumb_image = get_post_thumbnail_id();
                 $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
             }
             $item_title = get_the_title();
             $permalink = get_permalink();
             $item_link = sf_portfolio_item_link();
             $items .= '<li itemscope class="clearfix portfolio-item deselected-item ' . $item_class . '">';
             // THUMBNAIL MEDIA TYPE SETUP
             $image_width = 700;
             $image_height = 350;
             if ($item_count == "5") {
                 $image_width = 500;
                 $image_height = 500;
             }
             if ($thumb_img_url == "") {
                 $thumb_img_url = "default";
             }
             $image = sf_aq_resize($thumb_img_url, $image_width, $image_height, true, false);
             if ($image) {
                 $items .= '<a ' . $item_link['config'] . '>';
                 $items .= '<img itemprop="image" class="main-image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                 $items .= '</a>';
             }
             if ($item_subtitle == "") {
                 $items .= '<div class="item-info">';
                 $items .= '<span class="item-title"><a href="' . $permalink . '">' . $item_title . '</a></span>';
                 $items .= '</div>';
             } else {
                 $items .= '<div class="item-info has-subtitle">';
                 $items .= '<span class="item-title"><a href="' . $permalink . '">' . $item_title . '</a></span>';
                 $items .= '<span><a href="' . $permalink . '">' . $item_subtitle . '</a></span>';
                 $items .= '</div>';
             }
             $items .= '</li>';
         }
     }
     wp_reset_postdata();
     if ($alt_display == "yes") {
         $items .= '</div></div>';
     } else {
         $items .= '</div>';
     }
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     $view_all = "";
     $portfolio_page = __($sf_options['portfolio_page'], 'swift-framework-plugin');
     if ($category_slug != "") {
         $has_button = true;
         $category_id = get_cat_ID($category_slug);
         $category_link = get_category_link($category_id);
         $view_all = '<a class="view-all hidden" href="' . esc_url($category_link) . '">' . $pagination_view_icon . '</a>';
     } else {
         if ($portfolio_page != "") {
             $view_all = '<a class="view-all hidden" href="' . get_permalink($portfolio_page) . '">' . $pagination_view_icon . '</a>';
         }
     }
     $output .= "\n\t" . '<div class="spb_portfolio_showcase_widget spb_content_element ' . $wrap_class . $width . $el_class . '">';
     if ($pagination == "yes") {
         $output .= "\n\t\t" . $view_all;
     }
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= $title != '' ? "\n\t\t\t" . $this->spb_title($title, $title_class, true) : '';
     $output .= "\n\t\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     global $sf_has_portfolio_showcase, $sf_include_carousel;
     if ($alt_display) {
         $sf_include_carousel = true;
     } else {
         $sf_has_portfolio_showcase = true;
     }
     return $output;
 }
 protected function content($atts, $content = null)
 {
     $title = $category = $item_class = $width = $hover_style = $gutters = $fullwidth = $list_class = $el_class = $output = $filter = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', "item_count" => '12', 'item_columns' => '4', 'fullwidth' => 'no', 'gutters' => 'yes', "category" => 'all', 'hover_style' => 'default', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     /* SIDEBAR CONFIG
        ================================================== */
     global $sf_sidebar_config, $sf_options;
     $sidebars = '';
     if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sf_sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     if (is_singular('portfolio')) {
         $sidebars = "no-sidebars";
     }
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     global $post, $wp_query, $sf_carouselID;
     if ($sf_carouselID == "") {
         $sf_carouselID = 1;
     } else {
         $sf_carouselID++;
     }
     $portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'portfolio-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
     $portfolio_items = new WP_Query($portfolio_args);
     $count = 0;
     $figure_width = 300;
     $figure_height = 225;
     if ($item_columns == "3") {
         $figure_width = 400;
         $figure_height = 300;
     }
     if ($item_columns == "2") {
         $figure_width = 600;
         $figure_height = 450;
     }
     // Thumb Type
     if ($hover_style == "default" && function_exists('sf_get_thumb_type')) {
         $list_class = sf_get_thumb_type();
     } else {
         $list_class = 'thumbnail-' . $hover_style;
     }
     if ($gutters == "no") {
         $list_class .= ' no-gutters';
     } else {
         $list_class .= ' gutters';
     }
     $items .= '<div id="carousel-' . $sf_carouselID . '" class="portfolio-items carousel-items clearfix ' . $list_class . '" data-columns="' . $item_columns . '" data-auto="false">';
     while ($portfolio_items->have_posts()) {
         $portfolio_items->the_post();
         $port_hover_style = $port_hover_text_style = '';
         $item_title = get_the_title();
         $thumb_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true);
         $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
         $thumb_video = sf_get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
         $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image');
         $thumb_link_type = sf_get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
         $thumb_link_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_url', true);
         $thumb_lightbox_thumb = rwmb_meta('sf_thumbnail_image', 'type=image&size=large');
         $thumb_lightbox_image = rwmb_meta('sf_thumbnail_link_image', 'type=image&size=large');
         $thumb_lightbox_video_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
         $thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
         $port_hover_bg_color = sf_get_post_meta($post->ID, 'sf_port_hover_bg_color', true);
         $port_hover_text_color = sf_get_post_meta($post->ID, 'sf_port_hover_text_color', true);
         foreach ($thumb_image as $detail_image) {
             $thumb_img_url = $detail_image['url'];
             break;
         }
         if (!$thumb_image) {
             $thumb_image = get_post_thumbnail_id();
             $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
         }
         $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
         $item_title = get_the_title();
         $item_subtitle = sf_get_post_meta($post->ID, 'sf_portfolio_subtitle', true);
         $permalink = get_permalink();
         $item_link = sf_portfolio_item_link();
         if ($port_hover_bg_color != "") {
             $overlay_opacity = $sf_options['overlay_opacity'];
             if ($overlay_opacity == 100) {
                 $overlay_opacity = '1';
             } else {
                 $overlay_opacity = '0.' . $overlay_opacity;
             }
             $port_hover_bg_rgb = sf_hex2rgb($port_hover_bg_color);
             $port_hover_style = 'style="background-color:rgba(' . $port_hover_bg_rgb['red'] . ',' . $port_hover_bg_rgb['green'] . ',' . $port_hover_bg_rgb['blue'] . ',' . $overlay_opacity . ');"';
         }
         if ($port_hover_text_color != "") {
             $port_hover_text_style = 'style="color: ' . $port_hover_text_color . ';"';
         }
         $items .= '<div itemscope data-id="id-' . $count . '" class="clearfix carousel-item portfolio-item">';
         $items .= '<figure class="animated-overlay overlay-style">';
         // THUMBNAIL MEDIA TYPE SETUP
         if ($thumb_type == "video") {
             $video = sf_video_embed($thumb_video, $figure_width, $figure_height);
             $items .= $video;
         } else {
             if ($thumb_type == "slider") {
                 $items .= '<div class="flexslider thumb-slider"><ul class="slides">';
                 foreach ($thumb_gallery as $image) {
                     $alt = $image['alt'];
                     if (!$alt) {
                         $alt = $image['title'];
                     }
                     $items .= "<li><a " . $item_link['config'] . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
                 }
                 $items .= '</ul></div>';
             } else {
                 if ($thumb_type == "image" && $thumb_img_url == "") {
                     $thumb_img_url = "default";
                 }
                 $image = sf_aq_resize($thumb_img_url, $figure_width, $figure_height, true, false);
                 if ($image) {
                     $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                     $items .= '<a ' . $item_link['config'] . '></a>';
                     $items .= '<figcaption ' . $port_hover_style . '><div class="thumb-info">';
                     $items .= '<h4 ' . $port_hover_text_style . '>' . $item_title . '</h4>';
                     if ($item_subtitle != "") {
                         $items .= '<div class="name-divide"></div>';
                         $items .= '<h5 ' . $port_hover_text_style . '>' . $item_subtitle . '</h5>';
                     }
                     $items .= '</div></figcaption>';
                 }
             }
         }
         $items .= '</figure>';
         $items .= '</div>';
         $count++;
     }
     wp_reset_query();
     wp_reset_postdata();
     $items .= '</div>';
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_portfolio_carousel_widget carousel-asset spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= "\n\t\t" . '<div class="title-wrap clearfix">';
     if ($title != '') {
         $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
     }
     $output .= spb_carousel_arrows();
     $output .= '</div>';
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_include_carousel, $sf_include_isotope;
     $sf_include_carousel = true;
     $sf_include_isotope = true;
     return $output;
 }
Пример #8
0
 protected function content($atts, $content = null)
 {
     global $sf_options;
     $title = $width = $wrap_class = $title_class = $excerpt_length = $item_class = $offset = $el_class = $output = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'item_columns' => '3', 'display_type' => 'standard', 'carousel' => 'no', "item_count" => '4', "category" => '', "offset" => 0, "posts_order" => 'ASC', "excerpt_length" => '20', 'fullwidth' => 'no', 'gutters' => 'yes', 'button_enabled' => 'no', 'pagination' => 'no', 'post_type' => 'post', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $view_all_icon = apply_filters('sf_view_all_icon', '<i class="ss-layergroup"></i>');
     $pagination_view_icon = apply_filters('sf_pagination_view_icon', '<i class="sf-icon-quickview"></i>');
     /* CATEGORY SLUG MODIFICATION
        ================================================== */
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     /* SIDEBAR CONFIG
        ================================================== */
     global $sf_sidebar_config;
     $sidebars = '';
     if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sf_sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     /* BLOG QUERY SETUP
        ================================================== */
     global $post, $wp_query;
     if (get_query_var('paged')) {
         $paged = get_query_var('paged');
     } elseif (get_query_var('page')) {
         $paged = get_query_var('page');
     } else {
         $paged = 1;
     }
     $recent_post_args = array('post_type' => $post_type, 'post_status' => 'publish', 'category_name' => $category_slug, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order);
     $recent_posts = new WP_Query($recent_post_args);
     $count = 0;
     $image_width = 270;
     $image_height = 270;
     if ($item_columns == "1") {
         $image_width = 720;
         $image_height = 720;
         $item_class = 'col-sm-12';
     } else {
         if ($item_columns == "2") {
             $image_width = 540;
             $image_height = 540;
             $item_class = 'col-sm-6';
         } else {
             if ($item_columns == "3") {
                 $image_width = 360;
                 $image_height = 360;
                 $item_class = 'col-sm-4';
             } else {
                 if ($item_columns == "5") {
                     $image_width = 360;
                     $image_height = 360;
                     $item_class = 'col-sm-sf-5';
                 } else {
                     $item_class = 'col-sm-3';
                 }
             }
         }
     }
     if ($display_type == "standard-row") {
         $item_class = 'col-sm-12';
     }
     $list_class = 'posts-type-' . $display_type;
     if ($display_type == "standard" || $display_type == "standard-row" && $carousel == "no") {
         $list_class .= ' row';
     }
     if ($gutters == "no") {
         $list_class .= ' no-gutters';
     }
     if ($display_type == "showcase") {
         $carousel = "yes";
         $list_class .= ' staged-carousel';
         if ($pagination == "yes") {
             $wrap_class = "has-pagination ";
         }
         $title_class = "center-title";
         if ($sidebars == "no-sidebars") {
             $fullwidth = "yes";
         }
     }
     if ($display_type == "list") {
         $carousel = "no";
     }
     if ($carousel == "yes") {
         global $sf_carouselID;
         if ($sf_carouselID == "") {
             $sf_carouselID = 1;
         } else {
             $sf_carouselID++;
         }
         $item_class = 'carousel-item';
     }
     if ($display_type == "bold") {
         $item_class .= ' vr-standard';
     }
     if ($carousel == "yes") {
         $items .= '<div class="posts-carousel carousel-wrap">';
         if ($display_type == "showcase") {
             $items .= spb_carousel_arrows(true);
         }
         $items .= '<div id="carousel-' . $sf_carouselID . '" class="recent-posts carousel-items ' . $list_class . ' clearfix" data-columns="' . $item_columns . '" data-auto="false" data-pagination="' . $pagination . '">';
     } else {
         $items .= '<div class="recent-posts ' . $list_class . ' clearfix">';
     }
     while ($recent_posts->have_posts()) {
         $recent_posts->the_post();
         $count++;
         if ($count > $item_count) {
             break;
         }
         $items .= sf_get_recent_post_item($post, $display_type, $excerpt_length, $item_class);
     }
     wp_reset_postdata();
     if ($carousel == "yes") {
         $items .= '</div></div>';
     } else {
         $items .= '</div>';
     }
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $has_button = false;
     $page_button = $title_wrap_class = $view_all = "";
     $blog_page = __($sf_options['blog_page'], 'swift-framework-plugin');
     if ($category_slug != "") {
         $has_button = true;
         $category_id = get_cat_ID($category_slug);
         $category_link = get_category_link($category_id);
         $page_button = '<a class="sf-button medium white sf-icon-stroke " href="' . esc_url($category_link) . '">' . $view_all_icon . '<span class="text">' . __("VIEW ALL ARTICLES", 'swift-framework-plugin') . '</span></a>';
         $view_all = '<a class="view-all hidden" href="' . esc_url($category_link) . '">' . $pagination_view_icon . '</a>';
     } else {
         if ($blog_page != "") {
             $has_button = true;
             $page_button = '<a class="sf-button medium white sf-icon-stroke " href="' . get_permalink($blog_page) . '">' . $view_all_icon . '<span class="text">' . __("VIEW ALL ARTICLES", 'swift-framework-plugin') . '</span></a>';
             $view_all = '<a class="view-all hidden" href="' . get_permalink($blog_page) . '">' . $pagination_view_icon . '</a>';
         }
     }
     if ($has_button && $button_enabled == "yes") {
         $title_wrap_class .= 'has-button ';
     }
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $title_wrap_class .= 'container ';
     }
     $output .= "\n\t" . '<div class="spb_recent_posts_widget spb_content_element ' . $wrap_class . $width . $el_class . '">';
     if ($display_type == "showcase" && $pagination == "yes") {
         $output .= "\n\t\t" . $view_all;
     }
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     if (spb_get_theme_name() == "joyn") {
         if ($title != '') {
             $output .= "\n\t\t" . '<div class="title-wrap clearfix ' . $title_wrap_class . '">';
             $output .= '<h3 class="spb-heading ' . $title_class . '"><span>' . $title . '</span></h3>';
             $output .= '</div>';
         }
     } else {
         $output .= "\n\t\t" . '<div class="title-wrap clearfix ' . $title_wrap_class . '">';
         if ($title != '') {
             $output .= '<h3 class="spb-heading ' . $title_class . '"><span>' . $title . '</span></h3>';
         }
         if ($carousel == "yes" && $display_type != "showcase") {
             $output .= spb_carousel_arrows();
         }
         if ($has_button && $button_enabled == "yes") {
             $output .= $page_button;
         }
         $output .= '</div>';
     }
     $output .= "\n\t\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_include_isotope, $sf_include_carousel;
     $sf_include_isotope = true;
     if ($carousel == "yes") {
         $sf_include_carousel = true;
     }
     return $output;
 }