Пример #1
0
 protected function content($atts, $content = null)
 {
     $title = $link = $size = $el_position = $full_width = $width = $el_class = '';
     extract(shortcode_atts(array('title' => '', 'link' => '', 'size' => '1280x720', 'el_position' => '', 'width' => '1/1', 'full_width' => 'no', 'el_class' => ''), $atts));
     $output = '';
     if ($link == '') {
         return null;
     }
     $video_h = '';
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $size = str_replace(array('px', ' '), array('', ''), $size);
     $size = explode("x", $size);
     $video_w = $size[0];
     if (count($size) > 1) {
         $video_h = $size[1];
     }
     $embed = sf_video_embed($link, $video_w, $video_h);
     if ($full_width == "yes") {
         $output .= "\n\t" . '<div class="spb_video_widget full-width spb_content_element ' . $width . $el_class . '">';
     } else {
         $output .= "\n\t" . '<div class="spb_video_widget spb_content_element ' . $width . $el_class . '">';
     }
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= $title != '' ? "\n\t\t\t" . $this->spb_title($title, '') : '';
     $output .= $embed;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     return $output;
 }
Пример #2
0
 protected function content($atts, $content = null)
 {
     $options = get_option('sf_dante_options');
     $title = $category = $item_class = $excerpt_length = $width = $offset = $el_class = $output = $filter = $items = $el_position = $item_count = '';
     extract(shortcode_atts(array('title' => '', 'show_title' => 'yes', 'show_excerpt' => 'yes', "excerpt_length" => '20', "item_count" => '12', "show_details" => 'yes', "offset" => '0', "posts_order" => 'ASC', "category" => 'all', '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);
     global $post, $wp_query, $sf_carouselID;
     if ($sf_carouselID == "") {
         $sf_carouselID = 1;
     } else {
         $sf_carouselID++;
     }
     $blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'no_found_rows' => 1, 'category_name' => $category_slug, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order);
     $blog_items = new WP_Query($blog_args);
     $count = $columns = 0;
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     if (is_singular('portfolio')) {
         $sidebar_config = "no-sidebars";
     }
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $item_class = 'span2';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $item_class = 'span-bs-quarter';
         } else {
             $item_class = 'span3';
         }
     }
     if ($width == "1/4") {
         $columns = 1;
     } else {
         if ($width == "1/2") {
             $columns = 2;
         } else {
             if ($width == "3/4") {
                 $columns = 3;
             } else {
                 $columns = 4;
             }
         }
     }
     $items .= '<div class="carousel-wrap">';
     $items .= '<div id="carousel-' . $sf_carouselID . '" class="blog-items carousel-items clearfix" data-columns="' . $columns . '">';
     while ($blog_items->have_posts()) {
         $blog_items->the_post();
         $item_title = get_the_title();
         $post_author = get_the_author_link();
         $post_date = get_the_date();
         $post_comments = get_comments_number();
         $post_category = get_the_category();
         $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);
         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();
         $post_permalink = get_permalink();
         $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
         $post_excerpt = '';
         if ($custom_excerpt != '') {
             $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
         } else {
             $post_excerpt = sf_excerpt($excerpt_length);
         }
         if ($thumb_link_type == "link_to_url") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
             $item_icon = "ss-link";
         } else {
             if ($thumb_link_type == "link_to_url_nw") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                 $item_icon = "ss-link";
             } else {
                 if ($thumb_link_type == "lightbox_thumb") {
                     $link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                     $item_icon = "ss-view";
                 } else {
                     if ($thumb_link_type == "lightbox_image") {
                         $lightbox_image_url = '';
                         foreach ($thumb_lightbox_image as $image) {
                             $lightbox_image_url = $image['full_url'];
                         }
                         $link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                         $item_icon = "ss-view";
                     } else {
                         if ($thumb_link_type == "lightbox_video") {
                             $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                             $item_icon = "ss-video";
                         } else {
                             $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                             $item_icon = "ss-navigateright";
                         }
                     }
                 }
             }
         }
         $items .= '<div itemscope data-id="id-' . $count . '" class="clearfix carousel-item recent-post ' . $item_class . '">';
         $items .= '<figure class="animated-overlay overlay-alt">';
         // THUMBNAIL MEDIA TYPE SETUP
         if ($thumb_type == "video") {
             $video = sf_video_embed($thumb_video, 270, 202);
             $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 " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
                 }
                 $items .= '</ul></div>';
             } else {
                 if ($thumb_img_url == "") {
                     $thumb_img_url = "default";
                 }
                 $image = sf_aq_resize($thumb_img_url, 420, 315, true, false);
                 if ($image) {
                     $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                     $items .= '<a ' . $link_config . '></a>';
                     if ($show_title == "yes") {
                         $items .= '<figcaption><div class="thumb-info thumb-info-alt">';
                         $items .= '<i class="' . $item_icon . '"></i>';
                         $items .= '</div></figcaption>';
                     } else {
                         $items .= '<figcaption><div class="thumb-info">';
                         $items .= '<h4>' . $item_title . '</h4>';
                         $items .= '<i class="' . $item_icon . '"></i>';
                         $items .= '</div></figcaption>';
                     }
                 }
             }
         }
         $items .= '</figure>';
         $items .= '<div class="details-wrap">';
         // POST TITLE
         if ($show_title == "yes") {
             $items .= '<h5><a href="' . $post_permalink . '">' . $item_title . '</a></h5>';
         }
         if ($show_details == "yes") {
             $items .= '<div class="post-details">' . sprintf(__('%1$s - %2$s', 'swiftframework'), $post_date, sf_get_comments_number($post->ID)) . '</div>';
         }
         // POST EXCERPT
         if ($excerpt_length != "0" && $show_excerpt == "yes") {
             $items .= '<div class="excerpt">' . $post_excerpt . '</div>';
         }
         $items .= '</div>';
         $items .= '</div>';
         $count++;
     }
     wp_reset_query();
     wp_reset_postdata();
     $items .= '</div>';
     $items .= '<a href="#" class="carousel-prev"><i class="ss-navigateleft"></i></a><a href="#" class="carousel-next"><i class="ss-navigateright"></i></a>';
     $options = get_option('sf_dante_options');
     if ($options['enable_swipe_indicators']) {
         $items .= '<div class="sf-swipe-indicator"></div>';
     }
     $items .= '</div>';
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_posts_carousel_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper carousel-wrap alt-nav">';
     if ($title != '') {
         if ($width == "col-sm-12") {
             $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading spb-center-heading"><span>' . $title . '</span></h3></div>';
         } else {
             $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading"><span>' . $title . '</span></h3></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
    function sf_portfolio_detail_media($extra_class)
    {
        global $post;
        $media_type = $media_image = $media_video = $media_gallery = '';
        $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true);
        $use_thumb_content = sf_get_post_meta($post->ID, 'sf_thumbnail_content_main_detail', true);
        $hide_details = sf_get_post_meta($post->ID, 'sf_hide_details', true);
        $show_social = sf_get_post_meta($post->ID, 'sf_social_sharing', true);
        $item_categories = get_the_term_list($post->ID, 'portfolio-category', '<li>', '</li><li>', '</li>');
        $item_link = sf_get_post_meta($post->ID, 'sf_portfolio_external_link', true);
        if ($use_thumb_content) {
            $media_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true);
            $media_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
            $media_video = sf_get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
            $media_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image-onecol');
        } else {
            $media_type = sf_get_post_meta($post->ID, 'sf_detail_type', true);
            $media_image = rwmb_meta('sf_detail_image', 'type=image&size=full');
            $media_video = sf_get_post_meta($post->ID, 'sf_detail_video_url', true);
            $media_gallery = rwmb_meta('sf_detail_gallery', 'type=image&size=thumb-image-onecol');
            $media_slider = sf_get_post_meta($post->ID, 'sf_detail_rev_slider_alias', true);
            $media_layerslider = sf_get_post_meta($post->ID, 'sf_detail_layer_slider_alias', true);
            $custom_media = sf_get_post_meta($post->ID, 'sf_custom_media', true);
        }
        foreach ($media_image as $detail_image) {
            $media_image_url = $detail_image['url'];
            $share_image_url = $media_image_url;
            break;
        }
        if (!$media_image) {
            $media_image = get_post_thumbnail_id();
            $media_image_url = wp_get_attachment_url($media_image, 'full');
            $share_image_url = $media_image_url;
        }
        $image_caption = $image_alt = $image_title = "";
        $image_meta = sf_get_attachment_meta($media_image);
        if (isset($image_meta)) {
            $image_caption = esc_attr($image_meta['caption']);
            $image_title = esc_attr($image_meta['title']);
            $image_alt = esc_attr($image_meta['alt']);
        }
        // META VARIABLES
        $media_width = 850;
        $video_height = 638;
        if ($fw_media_display) {
            $media_width = 2000;
            $video_height = 800;
        }
        $media_height = NULL;
        ?>
			<figure class="media-wrap <?php 
        echo $extra_class;
        ?>
">
				<?php 
        if ($media_type == "video") {
            ?>
					
					<?php 
            echo sf_video_embed($media_video, $media_width, $video_height);
            ?>
					
				<?php 
        } else {
            if ($media_type == "slider") {
                ?>
					
					<div class="flexslider item-slider">
						<ul class="slides">
						<?php 
                foreach ($media_gallery as $image) {
                    echo "<li>";
                    if (!empty($image['caption'])) {
                        echo "<p class='flex-caption'>{$image['caption']}</p>";
                    }
                    echo "<img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' />";
                    echo "</li>";
                }
                ?>
										
						</ul>
					</div>
					
				<?php 
            } else {
                if ($media_type == "layer-slider") {
                    ?>
					
					<div class="layerslider">
						
						<?php 
                    if ($media_slider != "") {
                        echo do_shortcode('[rev_slider ' . $media_slider . ']');
                    } else {
                        echo do_shortcode('[layerslider id="' . $media_layerslider . '"]');
                    }
                    ?>
						
					</div>
						
				<?php 
                } else {
                    if ($media_type == "custom") {
                        echo $custom_media;
                    } else {
                        if ($media_type != "none") {
                            ?>
					
					<?php 
                            if ($media_type == "image" && $media_image_url == "") {
                                $media_image_url = "default";
                            }
                            $detail_image = sf_aq_resize($media_image_url, $media_width, $media_height, true, false);
                            ?>
					
					<?php 
                            if ($detail_image) {
                                ?>
						
						<img itemprop="image" src="<?php 
                                echo $detail_image[0];
                                ?>
" width="<?php 
                                echo $detail_image[1];
                                ?>
" height="<?php 
                                echo $detail_image[2];
                                ?>
" alt="<?php 
                                echo $image_alt;
                                ?>
" title="<?php 
                                echo $image_title;
                                ?>
" />
						
					<?php 
                            }
                            ?>
					
				<?php 
                        }
                    }
                }
            }
        }
        ?>
			</figure>
		<?php 
    }
Пример #4
0
    function widget($args, $instance)
    {
        global $post;
        extract($args);
        // Widget Options
        $title = apply_filters('widget_title', $instance['title']);
        // Title
        $post_id = $instance['post_id'];
        // Post ID
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        $infocus_post = get_post($post_id);
        ?>
			
			<div class="infocus-item">
				
				<?php 
        $post_title = $infocus_post->post_title;
        $post_permalink = get_post_permalink($infocus_post);
        $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $post_id);
        $thumb_video = sf_get_post_meta($post_id, 'sf_thumbnail_video_url', true);
        foreach ($thumb_image as $detail_image) {
            $thumb_img_url = $detail_image['url'];
            break;
        }
        if (!$thumb_image) {
            $thumb_image = get_post_thumbnail_id($post_id);
            $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
        }
        $image = sf_aq_resize($thumb_img_url, 300, 225, true, false);
        ?>
				<figure class="animated-overlay overlay-alt">
					<?php 
        if ($thumb_video != "") {
            ?>
						<?php 
            echo sf_video_embed($thumb_video, 300, 200);
            ?>
					<?php 
        } else {
            if ($image) {
                ?>
						<img src="<?php 
                echo $image[0];
                ?>
" width="<?php 
                echo $image[1];
                ?>
" height="<?php 
                echo $image[2];
                ?>
" />
						<a href="<?php 
                echo $post_permalink;
                ?>
" class="infocus-image"></a>
						<figcaption>
							<div class="thumb-info thumb-info-alt">
								<i class="ss-navigateright"></i>
							</div>
						</figcaption>
					<?php 
            }
        }
        ?>
				</figure>
								
				<div class="infocus-title clearfix">
					<h5><a href="<?php 
        echo $post_permalink;
        ?>
" title="<?php 
        echo $post_title;
        ?>
"><?php 
        echo $post_title;
        ?>
</a></h5>
					<div class="comments-likes">
					<?php 
        if (function_exists('lip_love_it_link')) {
            echo lip_love_it_link($post_id, '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false);
        }
        ?>
					</div>
				</div>
				
			</div>
							
			<?php 
        echo $after_widget;
    }
                ?>
						<figure class="media-wrap col-sm-9">
						<?php 
            } else {
                ?>
						<figure class="media-wrap col-sm-12">
						<?php 
            }
            ?>
								
						<?php 
            if ($media_type == "video") {
                ?>
							
							<?php 
                echo sf_video_embed($media_video, $media_width, $video_height);
                ?>
							
						<?php 
            } else {
                if ($media_type == "slider") {
                    ?>
							
							<div class="flexslider item-slider">
								
								<ul class="slides">
										
								<?php 
                    foreach ($media_gallery as $image) {
                        echo "<li>";
                        if (!empty($image['caption'])) {
Пример #6
0
 function sf_portfolio_items($display_type, $columns, $show_title, $show_subtitle, $show_excerpt, $hover_show_excerpt, $excerpt_length, $item_count, $category, $exclude_categories, $pagination, $sidebars)
 {
     /* OUTPUT VARIABLE
     			================================================== */
     $portfolio_items_output = "";
     $count = 0;
     /* CATEGORY SLUG MODIFICATION
        ================================================== */
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     /* PORTFOLIO 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;
     }
     $portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'paged' => $paged, 'portfolio-category' => $category_slug, 'posts_per_page' => $item_count, 'tax_query' => array(array('taxonomy' => 'portfolio-category', 'field' => 'id', 'terms' => array($exclude_categories), 'operator' => 'NOT IN')));
     $portfolio_items = new WP_Query($portfolio_args);
     /* LIST CLASS CONFIG
     			================================================== */
     $list_class = '';
     if ($display_type == "masonry" || $display_type == "masonry-gallery") {
         $list_class .= 'masonry-items filterable-items col-' . $columns . ' row clearfix';
     } else {
         if ($display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
             $list_class .= 'masonry-items masonry-fw filterable-items col-' . $columns . ' row clearfix';
         } else {
             if ($display_type == "gallery") {
                 $list_class .= 'gallery-portfolio filterable-items col-' . $columns . ' row clearfix';
             } else {
                 $list_class .= 'standard-portfolio filterable-items col-' . $columns . ' row clearfix';
             }
         }
     }
     /* ITEMS OUTPUT
     			================================================== */
     $options = get_option('sf_dante_options');
     $enable_portfolio_gallery = $options['enable_portfolio_gallery'];
     $portfolio_items_output .= '<ul class="portfolio-items ' . $list_class . '">' . "\n";
     while ($portfolio_items->have_posts()) {
         $portfolio_items->the_post();
         /* META VARIABLES
         			================================================== */
         $thumb_image = $thumb_gallery = $video = $item_class = $link_config = '';
         $thumb_width = 420;
         $thumb_height = 315;
         $video_height = 315;
         $thumb_type = get_post_meta($post->ID, 'sf_thumbnail_type', true);
         $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
         $thumb_video = get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
         if ($columns == "2") {
             $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image-twocol');
         } else {
             $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image');
         }
         $thumb_link_type = get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
         $thumb_link_url = 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 = get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
         $thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
         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 = get_post_meta($post->ID, 'sf_portfolio_subtitle', true);
         $permalink = get_permalink();
         $custom_excerpt = get_post_meta($post->ID, 'sf_custom_excerpt', true);
         $post_excerpt = '';
         if ($custom_excerpt != '') {
             $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
         } else {
             $post_excerpt = sf_excerpt($excerpt_length);
         }
         $post_terms = get_the_terms($post->ID, 'portfolio-category');
         $term_slug = " ";
         if (!empty($post_terms)) {
             foreach ($post_terms as $post_term) {
                 $term_slug = $term_slug . $post_term->slug . ' ';
             }
         }
         /* COLUMN VARIABLE CONFIG
         			================================================== */
         $item_class = $item_icon = "";
         if ($columns == "2") {
             if ($sidebars == "both-sidebars") {
                 $item_class = "col-sm-3 ";
             } else {
                 if ($sidebars == "one-sidebar") {
                     $item_class = "col-sm-4 ";
                 } else {
                     $item_class = "col-sm-6 ";
                     $thumb_width = 800;
                     $thumb_height = 600;
                     $video_height = 600;
                 }
             }
         } else {
             if ($columns == "3") {
                 if ($sidebars == "both-sidebars") {
                     $item_class = "col-sm-2 ";
                 } else {
                     if ($sidebars == "one-sidebar") {
                         $item_class = "span-third ";
                     } else {
                         $item_class = "col-sm-4 ";
                         $thumb_width = 600;
                         $thumb_height = 450;
                         $video_height = 450;
                     }
                 }
             } else {
                 if ($columns == "4") {
                     if ($sidebars == "both-sidebars") {
                         $item_class = "col-sm-3 ";
                     } else {
                         if ($sidebars == "one-sidebar") {
                             $item_class = "col-sm-2 ";
                         } else {
                             $item_class = "col-sm-3 ";
                         }
                     }
                 }
             }
         }
         if ($display_type == "masonry" || $display_type == "masonry-gallery" || $display_type == "masonry=fw" || $display_type == "masonry-gallery-fw") {
             $thumb_height = NULL;
         }
         /* DISPLAY TYPE CONFIG
         			================================================== */
         if ($display_type == "masonry" || $display_type == "masonry-gallery" || $display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
             $item_class .= "masonry-item masonry-gallery-item";
         } else {
             if ($display_type == "gallery") {
                 $item_class .= "gallery-item ";
             } else {
                 $item_class .= "standard ";
             }
         }
         /* LINK TYPE CONFIG
         			================================================== */
         if ($thumb_link_type == "link_to_url") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
             $item_icon = "ss-link";
         } else {
             if ($thumb_link_type == "link_to_url_nw") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                 $item_icon = "ss-link";
             } else {
                 if ($thumb_link_type == "lightbox_thumb") {
                     if ($enable_portfolio_gallery) {
                         $link_config = 'href="' . $thumb_img_url . '" class="view" rel="item-gallery"';
                     } else {
                         $link_config = 'href="' . $thumb_img_url . '" class="view"';
                     }
                     $item_icon = "ss-view";
                 } else {
                     if ($thumb_link_type == "lightbox_image") {
                         $lightbox_image_url = '';
                         foreach ($thumb_lightbox_image as $image) {
                             $lightbox_image_url = $image['full_url'];
                         }
                         if ($enable_portfolio_gallery) {
                             $link_config = 'href="' . $lightbox_image_url . '" class="view" rel="item-gallery"';
                         } else {
                             $link_config = 'href="' . $lightbox_image_url . '" class="view"';
                         }
                         $item_icon = "ss-view";
                     } else {
                         if ($thumb_link_type == "lightbox_video") {
                             $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                             $item_icon = "ss-video";
                         } else {
                             $link_config = 'href="' . $permalink . '" class="link-to-post"';
                             $item_icon = "ss-navigateright";
                         }
                     }
                 }
             }
         }
         /* ITEM OUTPUT
         			================================================== */
         $portfolio_items_output .= '<li itemscope itemtype="http://schema.org/CreativeWork" data-id="id-' . $count . '" class="clearfix portfolio-item ' . $item_class . ' ' . $term_slug . '">' . "\n";
         /* THUMBNAIL CONFIG
         			================================================== */
         if ($thumb_type != "none") {
             if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
                 $portfolio_items_output .= '<figure class="animated-overlay">' . "\n";
             } else {
                 $portfolio_items_output .= '<figure class="animated-overlay overlay-alt">' . "\n";
             }
             if ($thumb_type == "video") {
                 $video = sf_video_embed($thumb_video, $thumb_width, $video_height);
                 $portfolio_items_output .= $video;
             } else {
                 if ($thumb_type == "slider") {
                     $portfolio_items_output .= '<div class="flexslider thumb-slider"><ul class="slides">' . "\n";
                     foreach ($thumb_gallery as $image) {
                         $portfolio_items_output .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>" . "\n";
                     }
                     $portfolio_items_output .= '</ul></div>' . "\n";
                 } else {
                     if ($thumb_type == "image" && $thumb_img_url == "") {
                         $thumb_img_url = "default";
                     }
                     $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
                     if ($image) {
                         $portfolio_items_output .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />' . "\n";
                         $portfolio_items_output .= '<a ' . $link_config . '></a>';
                         if ($item_subtitle != "" && $hover_show_excerpt == "no" && ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-gallery-fw")) {
                             $portfolio_items_output .= '<figcaption><div class="thumb-info thumb-info-extended">';
                         } else {
                             if ($display_type == "standard" || $display_type == "masonry" || $display_type == "masonry-fw") {
                                 $portfolio_items_output .= '<figcaption><div class="thumb-info thumb-info-alt">';
                             } else {
                                 if ($hover_show_excerpt == "yes" && ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-gallery-fw")) {
                                     $portfolio_items_output .= '<figcaption><div class="thumb-info thumb-info-excerpt">';
                                 } else {
                                     $portfolio_items_output .= '<figcaption><div class="thumb-info">';
                                 }
                             }
                         }
                         if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-gallery-fw") {
                             if ($hover_show_excerpt == "yes") {
                                 $portfolio_items_output .= '<h4 itemprop="name headline">' . $item_title . '</h4>';
                                 $portfolio_items_output .= '<div itemprop="description">' . $post_excerpt . '</div>';
                             } else {
                                 $portfolio_items_output .= '<h4 itemprop="name headline">' . $item_title . '</h4>';
                                 $portfolio_items_output .= '<h5 itemprop="name alternative">' . $item_subtitle . '</h5>';
                             }
                         }
                         $portfolio_items_output .= '<i class="' . $item_icon . '"></i>';
                         $portfolio_items_output .= '</div></figcaption>';
                     }
                 }
             }
             $portfolio_items_output .= '</figure>' . "\n";
         }
         if ($display_type != "gallery" && $display_type != "masonry-gallery" && $display_type != "masonry-gallery-fw") {
             $portfolio_items_output .= '<div class="portfolio-item-details">' . "\n";
             $portfolio_items_output .= '<div class="comments-likes">';
             if (function_exists('lip_love_it_link')) {
                 $portfolio_items_output .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false);
             }
             $portfolio_items_output .= '</div>';
             if ($show_title == "yes") {
                 if ($enable_portfolio_gallery) {
                     $portfolio_items_output .= '<h3 class="portfolio-item-title" itemprop="name headline"><a href="' . $permalink . '" class="link-to-post">' . $item_title . '</a></h3>' . "\n";
                 } else {
                     $portfolio_items_output .= '<h3 class="portfolio-item-title" itemprop="name headline"><a ' . $link_config . '>' . $item_title . '</a></h3>' . "\n";
                 }
             }
             if ($show_subtitle == "yes" && $item_subtitle) {
                 $portfolio_items_output .= '<h5 class="portfolio-subtitle" itemprop="alternativeHeadline">' . $item_subtitle . '</h5>' . "\n";
             }
             if ($show_excerpt == "yes") {
                 $portfolio_items_output .= '<div class="portfolio-item-excerpt" itemprop="description">' . $post_excerpt . '</div>' . "\n";
             }
             $portfolio_items_output .= '</div>' . "\n";
         }
         $portfolio_items_output .= '</li>' . "\n";
         $count++;
     }
     wp_reset_postdata();
     $portfolio_items_output .= '</ul>' . "\n";
     /* PAGINATION OUTPUT
     			================================================== */
     if ($pagination == "yes") {
         if ($display_type == "masonry" || $display_type == "masonry-gallery" || $display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
             $portfolio_items_output .= '<div class="pagination-wrap masonry-pagination">';
         } else {
             $portfolio_items_output .= '<div class="pagination-wrap">';
         }
         $portfolio_items_output .= pagenavi($portfolio_items);
         $portfolio_items_output .= '</div>';
     }
     /* FUNCTION OUTPUT
     			================================================== */
     return $portfolio_items_output;
 }
    function sf_portfolio_detail_media()
    {
        global $post, $sf_options;
        $media_type = $media_image = $media_video = $media_audio = $media_mp4 = $media_ogg = $media_webm = $media_gallery = $image_alt = '';
        $default_detail_media = $sf_options['default_detail_media'];
        $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true);
        $use_thumb_content = sf_get_post_meta($post->ID, 'sf_thumbnail_content_main_detail', true);
        $hide_details = sf_get_post_meta($post->ID, 'sf_hide_details', true);
        $show_social = sf_get_post_meta($post->ID, 'sf_social_sharing', true);
        $item_categories = get_the_term_list($post->ID, 'portfolio-category', '<li>', '</li><li>', '</li>');
        $item_link = sf_get_post_meta($post->ID, 'sf_portfolio_external_link', true);
        $custom_media_height = sf_get_post_meta($post->ID, 'sf_media_height', true);
        if ($use_thumb_content) {
            $media_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true);
            $media_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
            $media_video = sf_get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
            $media_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image-onecol');
            $media_mp4 = sf_get_post_meta($post->ID, 'sf_thumbnail_video_mp4', true);
            $media_ogg = sf_get_post_meta($post->ID, 'sf_thumbnail_video_ogg', true);
            $media_webm = sf_get_post_meta($post->ID, 'sf_thumbnail_video_webm', true);
        } else {
            $media_type = sf_get_post_meta($post->ID, 'sf_detail_type', true);
            $media_image = rwmb_meta('sf_detail_image', 'type=image&size=full');
            $media_video = sf_get_post_meta($post->ID, 'sf_detail_video_url', true);
            $media_gallery = rwmb_meta('sf_detail_gallery', 'type=image&size=thumb-image-onecol');
            $media_slider = sf_get_post_meta($post->ID, 'sf_detail_rev_slider_alias', true);
            $media_layerslider = sf_get_post_meta($post->ID, 'sf_detail_layer_slider_alias', true);
            $custom_media = sf_get_post_meta($post->ID, 'sf_custom_media', true);
            $media_audio = sf_get_post_meta($post->ID, 'sf_detail_audio_url', true);
            $media_mp4 = sf_get_post_meta($post->ID, 'sf_detail_video_mp4', true);
            $media_ogg = sf_get_post_meta($post->ID, 'sf_detail_video_ogg', true);
            $media_webm = sf_get_post_meta($post->ID, 'sf_detail_video_webm', true);
        }
        if ($media_type == "") {
            $media_type = $default_detail_media;
        }
        foreach ($media_image as $detail_image) {
            $media_image_url = $detail_image['url'];
            $share_image_url = $media_image_url;
            $image_alt = esc_attr(sf_get_post_meta($detail_image['ID'], '_wp_attachment_image_alt', true));
            break;
        }
        if (!$media_image) {
            $media_image = get_post_thumbnail_id();
            $media_image_url = wp_get_attachment_url($media_image, 'full');
            $share_image_url = $media_image_url;
            $image_alt = esc_attr(sf_get_post_meta($media_image, '_wp_attachment_image_alt', true));
        }
        // META VARIABLES
        $media_width = 850;
        $video_height = 638;
        if ($fw_media_display) {
            $media_width = 2000;
            $video_height = 1125;
        }
        $media_height = null;
        if ($custom_media_height != "") {
            $media_height = $custom_media_height;
        }
        ?>

            <?php 
        if ($fw_media_display == "fw-media") {
            ?>
                <figure class="media-wrap fw-media-wrap media-type-<?php 
            echo esc_attr($media_type);
            ?>
">
            <?php 
        } else {
            if ($fw_media_display == "split") {
                ?>
                <figure class="media-wrap col-sm-9 media-type-<?php 
                echo esc_attr($media_type);
                ?>
">
            <?php 
            } else {
                ?>
                <figure class="media-wrap container media-type-<?php 
                echo esc_attr($media_type);
                ?>
">
            <?php 
            }
        }
        ?>

            <?php 
        if ($media_type == "video") {
            ?>

                <?php 
            echo sf_video_embed($media_video, $media_width, $video_height);
            ?>

            <?php 
        } else {
            if ($media_type == "slider") {
                ?>

                <div class="flexslider item-slider">

                    <ul class="slides">

                        <?php 
                foreach ($media_gallery as $image) {
                    echo "<li>";
                    if (!empty($image['caption'])) {
                        echo "<p class='flex-caption'>{$image['caption']}</p>";
                    }
                    echo "<img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' />";
                    echo "</li>";
                }
                ?>

                    </ul>

                </div>

            <?php 
            } else {
                if ($media_type == "gallery-stacked") {
                    ?>

                <?php 
                    foreach ($media_gallery as $image) {
                        echo "<img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' />";
                    }
                    ?>

            <?php 
                } else {
                    if ($media_type == "layer-slider") {
                        ?>

                <div class="layerslider">

                    <?php 
                        if ($media_slider != "") {
                            echo do_shortcode('[rev_slider ' . $media_slider . ']');
                        } else {
                            echo do_shortcode('[layerslider id="' . $media_layerslider . '"]');
                        }
                        ?>

                </div>

            <?php 
                    } else {
                        if ($media_type == "sh-video") {
                            $media_mp4 = 'mp4="' . $media_mp4 . '"';
                            $media_ogg = 'ogg="' . $media_ogg . '"';
                            $media_webm = 'webm="' . $media_webm . '"';
                            $poster = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'large', true);
                            if (isset($poster) & $poster != "") {
                                $poster = 'poster="' . $poster[0] . '"';
                            }
                            ?>
                <div class="sh-video-wrap">
                    <?php 
                            echo do_shortcode('[video ' . $media_mp4 . ' ' . $media_ogg . ' ' . $media_webm . ' ' . $poster . ']');
                            ?>
                </div>

            <?php 
                        } else {
                            if ($media_type == "audio") {
                                echo do_shortcode('[audio src="' . $media_audio . '"]');
                            } else {
                                if ($media_type == "custom") {
                                    echo do_shortcode($custom_media);
                                } else {
                                    ?>

                <?php 
                                    $detail_image = sf_aq_resize($media_image_url, $media_width, $media_height, true, false);
                                    ?>

                <?php 
                                    if ($detail_image) {
                                        ?>

                    <img itemprop="image" src="<?php 
                                        echo esc_url($detail_image[0]);
                                        ?>
" width="<?php 
                                        echo esc_attr($detail_image[1]);
                                        ?>
"
                         height="<?php 
                                        echo esc_attr($detail_image[2]);
                                        ?>
" alt="<?php 
                                        echo esc_attr($image_alt);
                                        ?>
"/>

                <?php 
                                    }
                                    ?>

            <?php 
                                }
                            }
                        }
                    }
                }
            }
        }
        ?>

            </figure>

        <?php 
    }
Пример #8
0
 protected function content($atts, $content = null)
 {
     $options = get_option('sf_dante_options');
     $title = $width = $excerpt_length = $item_class = $offset = $el_class = $output = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'item_columns' => '3', "item_count" => '4', "category" => '', "offset" => 0, "posts_order" => 'ASC', "excerpt_length" => '20', '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);
     global $post, $wp_query;
     $args = array('post_type' => 'post', 'post_status' => 'publish', 'category_name' => $category_slug, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order);
     $blog_items = query_posts($args);
     if ($item_columns == "1") {
         $item_class = 'col-sm-12';
     } else {
         if ($item_columns == "2") {
             $item_class = 'col-sm-6';
         } else {
             if ($item_columns == "3") {
                 $item_class = 'col-sm-4';
             } else {
                 $item_class = 'col-sm-3';
             }
         }
     }
     if (have_posts()) {
         $items .= '<ul class="recent-posts row clearfix">';
         while (have_posts()) {
             the_post();
             $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');
             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');
             }
             $item_title = get_the_title();
             $post_author = get_the_author_link();
             $post_date = get_the_date();
             $post_permalink = get_permalink();
             $post_comments = get_comments_number();
             $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
             $post_excerpt = '';
             if ($custom_excerpt != '') {
                 $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
             } else {
                 $post_excerpt = sf_excerpt($excerpt_length);
             }
             $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);
             $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
             $link_config = "";
             if ($thumb_link_type == "link_to_url") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
                 $item_icon = "ss-link";
             } else {
                 if ($thumb_link_type == "link_to_url_nw") {
                     $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                     $item_icon = "ss-link";
                 } else {
                     if ($thumb_link_type == "lightbox_thumb") {
                         $link_config = 'href="' . $thumb_img_url . '" class="view"';
                         $item_icon = "ss-view";
                     } else {
                         if ($thumb_link_type == "lightbox_image") {
                             $lightbox_image_url = '';
                             foreach ($thumb_lightbox_image as $image) {
                                 $lightbox_image_url = $image['full_url'];
                             }
                             $link_config = 'href="' . $lightbox_image_url . '" class="view"';
                             $item_icon = "ss-view";
                         } else {
                             if ($thumb_link_type == "lightbox_video") {
                                 $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                                 $item_icon = "ss-video";
                             } else {
                                 $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                                 $item_icon = "ss-navigateright";
                             }
                         }
                     }
                 }
             }
             $items .= '<li itemscope class="recent-post ' . $item_class . ' clearfix">';
             $items .= '<figure class="animated-overlay overlay-alt">';
             if ($thumb_type == "video") {
                 $video = sf_video_embed($thumb_video, 270, 202);
                 $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 '.{$link_config}.'><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
                     }
                     $items .= '</ul></div>';
                 } else {
                     if ($thumb_img_url == "" && $thumb_type != "none") {
                         $thumb_img_url = "default";
                     }
                     $image = sf_aq_resize($thumb_img_url, 420, 315, true, false);
                     if ($image) {
                         $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                         $items .= '<a ' . $link_config . '></a>';
                         $items .= '<figcaption><div class="thumb-info thumb-info-alt">';
                         $items .= '<i class="' . $item_icon . '"></i>';
                         $items .= '</div></figcaption>';
                     }
                 }
             }
             $items .= '</figure>';
             $items .= '<div class="details-wrap">';
             $items .= '<h5><a href="' . $post_permalink . '">' . $item_title . '</a></h5>';
             if ($excerpt_length != "0") {
                 $items .= '<div class="excerpt">' . $post_excerpt . '</div>';
             }
             $items .= '</div>';
             $items .= '<div class="post-item-details clearfix">';
             $items .= '<span class="post-date">' . $post_date . '</span>';
             $items .= '<div class="comments-likes">';
             if (comments_open()) {
                 $items .= '<a href="' . $post_permalink . '#comment-area"><i class="ss-chat"></i><span>' . $post_comments . '</span></a> ';
             }
             if (function_exists('lip_love_it_link')) {
                 $items .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false);
             }
             $items .= '</div>';
             $items .= '</div>';
             $items .= '</li>';
         }
         wp_reset_query();
         $items .= '</ul>';
     }
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $output .= "\n\t" . '<div class="spb_recent_posts_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper recent-posts-wrap">';
     $output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>' : '';
     $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);
     return $output;
 }
Пример #9
0
 function sf_get_recent_post_item($post, $display_type = "bold", $excerpt_length = 20, $item_class = "")
 {
     $recent_post = $recent_post_figure = $link_config = $item_icon = "";
     $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');
     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');
     }
     // POST META
     global $sf_options;
     $single_author = $sf_options['single_author'];
     $remove_dates = $sf_options['remove_dates'];
     $post_links_match_thumb = false;
     if (isset($sf_options['post_links_match_thumb'])) {
         $post_links_match_thumb = $sf_options['post_links_match_thumb'];
     }
     $post_author = get_the_author_link();
     $post_date = get_the_date();
     $post_date_str = get_the_date('Y-m-d');
     $item_title = get_the_title();
     $post_permalink = get_permalink();
     $post_comments = get_comments_number();
     $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
     $post_excerpt = '';
     if ($custom_excerpt != '') {
         $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
     } else {
         $post_excerpt = sf_excerpt($excerpt_length);
     }
     $post_permalink_config = 'href="' . $post_permalink . '" class="link-to-post"';
     if ($post_links_match_thumb) {
         $link_config = sf_post_item_link();
         $post_permalink_config = $link_config['config'];
     }
     $thumb_width = apply_filters('sf_recent_post_item_thumb_width', 360);
     $thumb_height = apply_filters('sf_recent_post_item_thumb_height', 270);
     if ($display_type == "standard-row") {
         $thumb_width = apply_filters('sf_recent_post_item_thumb_width', 400);
         $thumb_height = apply_filters('sf_recent_post_item_thumb_height', 300);
     }
     // MEDIA CONFIG
     $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);
     $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
     // LINK CONFIG
     if ($thumb_link_type == "link_to_url") {
         $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
         $item_icon = apply_filters('sf_post_link_icon', "ss-link");
     } else {
         if ($thumb_link_type == "link_to_url_nw") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
             $item_icon = apply_filters('sf_post_link_icon', "ss-link");
         } else {
             if ($thumb_link_type == "lightbox_thumb") {
                 $lightbox_id = rand();
                 if ($thumb_img_url != "") {
                     $link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox[' . $lightbox_id . ']"';
                 }
                 $item_icon = apply_filters('sf_post_lightbox_icon', "ss-view");
             } else {
                 if ($thumb_link_type == "lightbox_image") {
                     $lightbox_image_url = '';
                     foreach ($thumb_lightbox_image as $image) {
                         $lightbox_image_url = $image['full_url'];
                     }
                     $lightbox_id = rand();
                     if ($lightbox_image_url != "") {
                         $link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox[' . $lightbox_id . ']"';
                     }
                     $item_icon = apply_filters('sf_post_lightbox_icon', "ss-view");
                 } else {
                     if ($thumb_link_type == "lightbox_video") {
                         $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                         $item_icon = apply_filters('sf_post_video_icon', "ss-video");
                     } else {
                         $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                         $item_icon = apply_filters('sf_post_standard_icon', "ss-navigateright");
                     }
                 }
             }
         }
     }
     if ($thumb_type == "none") {
         $recent_post .= '<div itemscope class="recent-post no-thumb ' . $item_class . ' clearfix">';
     } else {
         $recent_post .= '<div itemscope class="recent-post has-thumb ' . $item_class . ' clearfix">';
     }
     $recent_post_figure .= '<div class="figure-wrap">';
     $recent_post_figure .= apply_filters('sf_before_recent_post_thumb', '');
     $recent_post_figure .= '<figure class="animated-overlay overlay-alt">';
     if ($thumb_type == "video") {
         $video = sf_video_embed($thumb_video, 400, 225);
         $recent_post_figure .= '<div class="video-thumb">' . $video . '</div>';
     } else {
         if ($thumb_type == "slider") {
             $recent_post_figure .= '<div class="flexslider thumb-slider"><ul class="slides">';
             foreach ($thumb_gallery as $image) {
                 $alt = $image['alt'];
                 if (!$alt) {
                     $alt = $image['title'];
                 }
                 $recent_post_figure .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
             }
             $recent_post_figure .= '</ul></div>';
         } else {
             if ($thumb_img_url == "" && $thumb_type != "none") {
                 $thumb_img_url = "default";
             }
             $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
             if ($image) {
                 $recent_post_figure .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                 $recent_post_figure .= '<a ' . $link_config . '></a>';
                 $recent_post_figure .= '<div class="figcaption-wrap"></div>';
                 if ($display_type == "showcase") {
                     $recent_post_figure .= '<figcaption><div class="thumb-info">';
                     $recent_post_figure .= '<h5><span class="post-date updated">' . $post_date . '</span></h5>';
                     $recent_post_figure .= '<h4>' . $item_title . '</h4>';
                     $recent_post_figure .= '</div></figcaption>';
                 } else {
                     $recent_post_figure .= '<figcaption><div class="thumb-info thumb-info-alt">';
                     $recent_post_figure .= '<i class="' . $item_icon . '"></i>';
                     $recent_post_figure .= '</div></figcaption>';
                 }
             }
         }
     }
     $recent_post_figure .= '</figure>';
     $recent_post_figure .= '</div>';
     if ($display_type == "bold") {
         $recent_post .= $recent_post_figure;
         $recent_post .= '<div class="details-wrap">';
         if ($thumb_type == "none") {
             $recent_post .= '<h2><a ' . $post_permalink_config . '>' . $item_title . '</a></h2>';
         } else {
             $recent_post .= '<h3><a ' . $post_permalink_config . '>' . $item_title . '</a></h3>';
         }
         $recent_post .= sf_get_post_details($post->ID, true);
         $recent_post .= '</div>';
     } else {
         if ($display_type == "list") {
             $recent_post .= '<a class="list-post-link" href="' . $post_permalink . '"></a>';
             if ($image) {
                 $recent_post_figure .= '<figure class="animated-overlay">';
                 $recent_post_figure .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                 $recent_post_figure .= '<a ' . $link_config . '></a>';
                 $recent_post_figure .= '<div class="figcaption-wrap"></div>';
                 $recent_post_figure .= '<figcaption><div class="thumb-info thumb-info-alt">';
                 $recent_post_figure .= '<i class="' . $item_icon . '"></i>';
                 $recent_post_figure .= '</div></figcaption>';
                 $recent_post_figure .= '</figure>';
             }
             $recent_post .= '<div class="details-wrap">';
             $recent_post .= '<h4>' . $item_title . '</h4>';
             $recent_post .= '<div class="post-item-details">';
             $recent_post .= '<span class="post-date updated">' . $post_date . '</span>';
             $recent_post .= '</div>';
             $recent_post .= '</div>';
         } else {
             if ($display_type == "bright") {
                 $recent_post .= '<div class="details-wrap">';
                 $recent_post .= '<div class="author-avatar">' . get_avatar(get_the_author_meta('ID'), '140') . '</div>';
                 $recent_post .= '<h6 class="post-item-author"><span class="author">' . sprintf('<a href="%2$s" rel="author" itemprop="author">%1$s</a>', $post_author, get_author_posts_url(get_the_author_meta('ID'))) . '</span></h6>';
                 $recent_post .= '<h2><a ' . $post_permalink_config . '>' . $item_title . '</a></h2>';
                 $recent_post .= '<div class="post-item-details">';
                 $recent_post .= '<span class="post-date updated">' . $post_date . '</span>';
                 $recent_post .= '</div>';
                 $recent_post .= '</div>';
             } else {
                 if ($display_type == "bold") {
                     $recent_post .= $recent_post_figure;
                     $recent_post .= '<div class="details-wrap">';
                     if ($thumb_type == "none") {
                         $recent_post .= '<h2><a ' . $post_permalink_config . '>' . $item_title . '</a></h2>';
                     } else {
                         $recent_post .= '<h3><a ' . $post_permalink_config . '>' . $item_title . '</a></h3>';
                     }
                     $recent_post = sf_get_post_details($post->ID, true);
                     $recent_post .= '</div>';
                 } else {
                     if ($display_type == "showcase") {
                         $recent_post .= $recent_post_figure;
                     } else {
                         $recent_post .= $recent_post_figure;
                         $recent_post .= '<div class="details-wrap">';
                         $recent_post .= '<h5><a ' . $post_permalink_config . '>' . $item_title . '</a></h5>';
                         $recent_post .= sf_get_post_details($post->ID, true);
                         if ($excerpt_length != "0" && $excerpt_length != "") {
                             $recent_post .= '<div class="excerpt">' . $post_excerpt . '</div>';
                         }
                         if (sf_theme_opts_name() == "sf_atelier_options" && $display_type == "standard-row") {
                             $recent_post .= '<a class="read-more-button" href="' . get_permalink() . '">' . __("Read more", "swiftframework") . '</a>';
                         }
                         $recent_post .= '</div>';
                     }
                 }
             }
         }
     }
     $recent_post .= '</div>';
     return $recent_post;
 }
Пример #10
0
    function widget($args, $instance)
    {
        global $post, $sf_options;
        extract($args);
        $remove_dates = $sf_options['remove_dates'];
        // Widget Options
        $title = apply_filters('widget_title', $instance['title']);
        // Title
        $post_id = $instance['post_id'];
        // Post ID
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        if (function_exists('icl_object_id')) {
            $post_id = icl_object_id($post_id, 'post', true);
        }
        $infocus_post = get_post($post_id);
        ?>

            <div class="infocus-item">

                <?php 
        $post_title = $infocus_post->post_title;
        $post_permalink = get_post_permalink($infocus_post);
        $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $post_id);
        $thumb_video = sf_get_post_meta($post_id, 'sf_thumbnail_video_url', true);
        foreach ($thumb_image as $detail_image) {
            $thumb_img_url = $detail_image['url'];
            break;
        }
        if (!$thumb_image) {
            $thumb_image = get_post_thumbnail_id($post_id);
            $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
        }
        $image = sf_aq_resize($thumb_img_url, 300, 225, true, false);
        $image_alt = esc_attr(sf_get_post_meta($thumb_image, '_wp_attachment_image_alt', true));
        ?>
                <figure class="animated-overlay overlay-alt">

                	<?php 
        if (sf_theme_opts_name() == "sf_atelier_options") {
            $post_date_month = get_the_date('M');
            $post_date_day = get_the_date('d');
            ?>
                	<div class="date-overlay narrow-date-block"><span class="month"><?php 
            echo $post_date_month;
            ?>
</span><span class="day"><?php 
            echo $post_date_day;
            ?>
</span></div>
                	<?php 
        }
        ?>

                    <?php 
        if ($thumb_video != "") {
            ?>
                        <?php 
            echo sf_video_embed($thumb_video, 300, 200);
            ?>
                    <?php 
        } else {
            if ($image) {
                ?>
                        <img src="<?php 
                echo $image[0];
                ?>
" width="<?php 
                echo $image[1];
                ?>
"
                             height="<?php 
                echo $image[2];
                ?>
" alt="<?php 
                echo $image_alt;
                ?>
"/>
                        <a href="<?php 
                echo $post_permalink;
                ?>
" class="infocus-image"></a>
                        <div class="figcaption-wrap"></div>
                        <figcaption>
                            <div class="thumb-info thumb-info-alt">
                                <?php 
                echo apply_filters('sf_next_icon', '<i class="ss-navigateright"></i>');
                ?>
                            </div>
                        </figcaption>
                    <?php 
            }
        }
        ?>
                </figure>

                <div class="infocus-title clearfix">

	                <?php 
        if (sf_theme_opts_name() == "sf_atelier_options") {
            ?>

						<h4><a href="<?php 
            echo $post_permalink;
            ?>
"
                           title="<?php 
            echo $post_title;
            ?>
"><?php 
            echo $post_title;
            ?>
</a></h4>

					<?php 
        } else {
            if (sf_theme_opts_name() == "sf_uplift_options") {
                ?>
						
						<h5><a href="<?php 
                echo $post_permalink;
                ?>
"
						   title="<?php 
                echo $post_title;
                ?>
"><?php 
                echo $post_title;
                ?>
</a></h5>
						  
						<?php 
                if (!$remove_dates) {
                    echo '<div class="blog-item-details">' . sprintf(__('<time datetime="%1$s">%2$s</time>', 'swiftframework'), get_the_date('Y-m-d'), get_the_date()) . '</div>';
                }
                ?>
						   
	                <?php 
            } else {
                ?>

	                    <h5><a href="<?php 
                echo $post_permalink;
                ?>
"
                           title="<?php 
                echo $post_title;
                ?>
"><?php 
                echo $post_title;
                ?>
</a></h5>

	                    <div class="comments-likes">
	                        <?php 
                if (function_exists('lip_love_it_link')) {
                    echo lip_love_it_link($post_id, '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false);
                }
                ?>
	                    </div>

                    <?php 
            }
        }
        ?>
                </div>

            </div>

            <?php 
        echo $after_widget;
    }
Пример #11
0
 function sf_get_post_item($postID, $blog_type, $show_title = "yes", $show_excerpt = "yes", $show_details = "yes", $excerpt_length = "20", $content_output = "excerpt", $show_read_more = "no")
 {
     $post_item = $thumb_img_url = $image_id = "";
     $options = get_option('sf_dante_options');
     $single_author = $options['single_author'];
     $remove_dates = false;
     if (isset($options['remove_dates']) && $options['remove_dates'] == 1) {
         $remove_dates = true;
     }
     global $post, $sf_sidebar_config;
     $post_format = get_post_format($postID);
     if ($post_format == "") {
         $post_format = 'standard';
     }
     $post_title = get_the_title();
     $post_author = get_the_author_link();
     $post_date = get_the_date();
     $post_categories = get_the_category_list(', ');
     $post_comments = get_comments_number();
     $post_permalink = get_permalink();
     $custom_excerpt = sf_get_post_meta($postID, 'sf_custom_excerpt', true);
     $post_excerpt = '';
     if ($content_output == "excerpt") {
         if ($custom_excerpt != '') {
             $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
         } else {
             if ($post_format == "quote") {
                 $post_excerpt = sf_get_the_content_with_formatting();
             } else {
                 $post_excerpt = sf_excerpt($excerpt_length);
             }
         }
     } else {
         $post_excerpt = sf_get_the_content_with_formatting();
     }
     if ($post_format == "chat") {
         $post_excerpt = sf_content(40);
     } else {
         if ($post_format == "audio") {
             $post_excerpt = do_shortcode(get_the_content());
         } else {
             if ($post_format == "video") {
                 $content = get_the_content();
                 $content = apply_filters('the_content', $content);
                 $post_excerpt = $content;
             } else {
                 if ($post_format == "link") {
                     $content = get_the_content();
                     $content = apply_filters('the_content', $content);
                     $post_excerpt = $content;
                 }
             }
         }
     }
     $post_item = $thumb_image = $thumb_width = $thumb_height = $bordered_thumb_width = $bordered_thumb_height = $video = $video_height = $bordered_video_height = $item_class = $link_config = $item_icon = $gallery_size = '';
     if ($blog_type == "mini") {
         if ($sf_sidebar_config == "no-sidebars") {
             $thumb_width = 446;
             $thumb_height = NULL;
             $video_height = 335;
         } else {
             $thumb_width = 370;
             $thumb_height = NULL;
             $video_height = 260;
         }
         $gallery_size = 'thumb-image';
     } else {
         if ($blog_type == "masonry" || $blog_type == "masonry-fw") {
             if ($sf_sidebar_config == "both-sidebars" || $blog_type == "masonry-fw") {
                 $item_class = "col-sm-3";
             } else {
                 $item_class = "col-sm-4";
             }
             $thumb_width = 480;
             $thumb_height = NULL;
             $video_height = 360;
             $gallery_size = 'thumb-image';
         } else {
             $thumb_width = 970;
             $thumb_height = NULL;
             $video_height = 728;
             $gallery_size = 'blog-image';
         }
     }
     $thumb_type = sf_get_post_meta($postID, 'sf_thumbnail_type', true);
     $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
     $thumb_video = sf_get_post_meta($postID, 'sf_thumbnail_video_url', true);
     $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=' . $gallery_size);
     $thumb_link_type = sf_get_post_meta($postID, 'sf_thumbnail_link_type', true);
     $thumb_link_url = sf_get_post_meta($postID, '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($postID, 'sf_thumbnail_link_video_url', true);
     $thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
     $image_id = 0;
     foreach ($thumb_image as $detail_image) {
         $image_id = $detail_image['ID'];
         $thumb_img_url = $detail_image['url'];
         break;
     }
     if (!$thumb_image) {
         $thumb_image = get_post_thumbnail_id($postID);
         $image_id = $thumb_image;
         $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
     }
     $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
     $item_figure = $link_config = "";
     // LINK TYPE VARIABLES
     if ($thumb_link_type == "link_to_url") {
         $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
         $item_icon = "ss-link";
     } else {
         if ($thumb_link_type == "link_to_url_nw") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
             $item_icon = "ss-link";
         } else {
             if ($thumb_link_type == "lightbox_thumb") {
                 $link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                 $item_icon = "ss-view";
             } else {
                 if ($thumb_link_type == "lightbox_image") {
                     $lightbox_image_url = '';
                     foreach ($thumb_lightbox_image as $image) {
                         $lightbox_image_url = $image['full_url'];
                     }
                     $link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                     $item_icon = "ss-view";
                 } else {
                     if ($thumb_link_type == "lightbox_video") {
                         $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                         $item_icon = "ss-video";
                     } else {
                         $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                         $item_icon = "ss-navigateright";
                     }
                 }
             }
         }
     }
     // THUMBNAIL MEDIA TYPE SETUP
     if ($thumb_type != "none") {
         $item_figure .= '<figure class="animated-overlay overlay-alt">';
         if ($thumb_type == "video") {
             $video = sf_video_embed($thumb_video, $thumb_width, $video_height);
             $item_figure .= $video;
         } else {
             if ($thumb_type == "slider") {
                 $item_figure .= '<div class="flexslider thumb-slider"><ul class="slides">';
                 foreach ($thumb_gallery as $image) {
                     $item_figure .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>";
                 }
                 $item_figure .= '</ul></div>';
             } else {
                 if ($thumb_img_url == "") {
                     $thumb_image = get_post_thumbnail_id($postID);
                     $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
                 }
                 $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
                 $thumbnail_id = get_post_thumbnail_id($postID);
                 $image_alt = sf_get_post_meta($image_id, '_wp_attachment_image_alt', true);
                 if ($image) {
                     $item_figure .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" />';
                     $item_figure .= '<a ' . $link_config . '></a>';
                     $item_figure .= '<figcaption><div class="thumb-info thumb-info-alt">';
                     $item_figure .= '<i class="' . $item_icon . '"></i>';
                     $item_figure .= '</div></figcaption>';
                 }
             }
         }
         $item_figure .= '</figure>';
     }
     // MASONRY STYLING
     if ($blog_type == "masonry" || $blog_type == "masonry-fw") {
         $post_item .= '<div class="masonry-item-wrap">';
         if ($post_format == "quote") {
             $post_item .= '<div class="quote-excerpt heading-font entry-title" itemprop="description">' . $post_excerpt . '</div>';
         } else {
             if ($post_format == "link") {
                 $post_item .= '<div class="link-excerpt heading-font entry-title" itemprop="description">' . $post_excerpt . '</div>';
             } else {
                 $post_item .= $item_figure;
             }
         }
         $post_item .= '<div class="details-wrap clearfix">';
         if ($show_title == "yes" && $post_format != "quote" && $post_format != "link") {
             if ($single_author && $remove_dates) {
                 $post_item .= '<h4 itemprop="name headline" class="entry-title no-details"><a href="' . $post_permalink . '">' . $post_title . '</a></h4>';
             } else {
                 $post_item .= '<h4 itemprop="name headline" class="entry-title"><a href="' . $post_permalink . '">' . $post_title . '</a></h4>';
             }
         }
         if ($show_details == "yes" && $post_format != "quote" && $post_format != "link") {
             if ($single_author && !$remove_dates) {
                 $post_item .= '<div class="blog-item-details">' . sprintf('<span class="date updated">%1$s</span>', $post_date) . '</div>';
             } else {
                 if (!$remove_dates) {
                     $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span> on <span class="date updated">%2$s</span>', 'swiftframework'), $post_author, $post_date) . '</div>';
                 } else {
                     if (!$single_author) {
                         $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span>', 'swiftframework'), $post_author) . '</div>';
                     }
                 }
             }
         }
         // POST EXCERPT
         if ($show_excerpt == "yes" && $post_excerpt != "0") {
             if ($post_format != "quote" && $post_format != "link") {
                 $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>';
             }
         }
         // POST DETAILS
         if (is_sticky()) {
             $post_item .= '<div class="sticky-post-icon"><i class="ss-bookmark"></i></div>';
         }
         if ($show_read_more == "yes") {
             $post_item .= '<a class="read-more-button" href="' . $post_permalink . '">' . __("Read more", "swiftframework") . '</a>';
         }
         if ($show_details == "yes") {
             $post_item .= '<div class="comments-likes">';
             if (comments_open()) {
                 $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area"><i class="ss-chat"></i><span>' . $post_comments . '</span></a></div>';
             }
             if (function_exists('lip_love_it_link')) {
                 $post_item .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false);
             }
             $post_item .= '</div>';
         }
         $post_item .= '<meta itemprop="datePublished" content="' . get_the_date('Y-m-d') . '"/>';
         $post_item .= '</div>';
         $post_item .= '</div>';
         // MINI STYLING
     } else {
         if ($blog_type == "mini") {
             $post_item .= '<div class="mini-blog-item-wrap">';
             if ($post_format == "quote" || $post_format == "link") {
                 $post_item .= '<div class="mini-alt-wrap">';
             } else {
                 $post_item .= $item_figure;
             }
             $post_item .= '<div class="blog-details-wrap">';
             if ($show_title == "yes" && $post_format != "quote" && $post_format != "link") {
                 $post_item .= '<h3 itemprop="name headline" class="entry-title"><a href="' . $post_permalink . '">' . $post_title . '</a></h3>';
             }
             if ($show_details == "yes" && $post_format != "quote" && $post_format != "link") {
                 if ($single_author && !$remove_dates) {
                     $post_item .= '<div class="blog-item-details">' . sprintf('<span class="date updated">%1$s</span>', $post_date) . '</div>';
                 } else {
                     if (!$remove_dates) {
                         $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span> on <span class="date updated">%2$s</span>', 'swiftframework'), $post_author, $post_date) . '</div>';
                     } else {
                         if (!$single_author) {
                             $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span>', 'swiftframework'), $post_author) . '</div>';
                         }
                     }
                 }
             }
             if ($show_excerpt == "yes") {
                 if ($post_format == "quote") {
                     $post_item .= '<div class="quote-excerpt heading-font" itemprop="description">' . $post_excerpt . '</div>';
                 } else {
                     if ($post_format == "link") {
                         $post_item .= '<div class="link-excerpt heading-font" itemprop="description"><i class="ss-link"></i>' . $post_excerpt . '</div>';
                     } else {
                         $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>';
                     }
                 }
             }
             if (is_sticky()) {
                 $post_item .= '<div class="sticky-post-icon"><i class="ss-bookmark"></i></div>';
             }
             if ($show_read_more == "yes") {
                 $post_item .= '<a class="read-more-button" href="' . $post_permalink . '">' . __("Read more", "swiftframework") . '</a>';
             }
             if ($show_details == "yes") {
                 $post_item .= '<div class="comments-likes">';
                 if ($post_format == "quote" || $post_format == "link") {
                     if ($single_author && !$remove_dates) {
                         $post_item .= '<div class="blog-item-details">' . sprintf('<span class="date updated">%1$s</span>', $post_date) . '</div>';
                     } else {
                         if (!$remove_dates) {
                             $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span> on <span class="date updated">%2$s</span>', 'swiftframework'), $post_author, $post_date) . '</div>';
                         } else {
                             if (!$single_author) {
                                 $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span>', 'swiftframework'), $post_author) . '</div>';
                             }
                         }
                     }
                 }
                 if (comments_open()) {
                     $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area"><i class="ss-chat"></i><span>' . $post_comments . '</span></a></div>';
                 }
                 if (function_exists('lip_love_it_link')) {
                     $post_item .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false);
                 }
                 $post_item .= '</div>';
             }
             $post_item .= '<meta itemprop="datePublished" content="' . get_the_date('Y-m-d') . '"/>';
             $post_item .= '</div>';
             if ($post_format == "quote" || $post_format == "link") {
                 $post_item .= '</div>';
             }
             $post_item .= '</div>';
             // STANDARD STYLING
         } else {
             if ($show_details == "yes") {
                 $post_item .= '<span class="standard-post-date" itemprop="datePublished">' . $post_date . '</span>';
             }
             $post_item .= $item_figure;
             if ($item_figure == "") {
                 $post_item .= '<div class="standard-post-content no-thumb clearfix">';
                 // open standard-post-content
             } else {
                 $post_item .= '<div class="standard-post-content clearfix">';
                 // open standard-post-content
             }
             if ($show_title && $post_format != "link" && $post_format != "quote") {
                 $post_item .= '<h1 itemprop="name headline" class="entry-title"><a href="' . $post_permalink . '">' . $post_title . '</a></h1>';
             }
             if ($show_details == "yes" && $post_format != "quote" && $post_format != "link") {
                 if ($single_author && !$remove_dates) {
                     $post_item .= '<div class="blog-item-details">' . sprintf('<span class="date updated">%1$s</span>', $post_date) . '</div>';
                 } else {
                     if (!$remove_dates) {
                         $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span> on <span class="date updated">%2$s</span>', 'swiftframework'), $post_author, $post_date) . '</div>';
                     } else {
                         if (!$single_author) {
                             $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span>', 'swiftframework'), $post_author) . '</div>';
                         }
                     }
                 }
             }
             if ($show_excerpt == "yes") {
                 if ($post_format == "quote") {
                     $post_item .= '<div class="quote-excerpt heading-font" itemprop="description">' . $post_excerpt . '</div>';
                 } else {
                     if ($post_format == "link") {
                         $post_item .= '<div class="link-excerpt heading-font" itemprop="description"><i class="ss-link"></i>' . $post_excerpt . '</div>';
                     } else {
                         $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>';
                     }
                 }
             }
             if (is_sticky()) {
                 $post_item .= '<div class="sticky-post-icon"><i class="ss-bookmark"></i></div>';
             }
             if ($show_read_more == "yes") {
                 $post_item .= '<a class="read-more-button" href="' . $post_permalink . '">' . __("Read more", "swiftframework") . '</a>';
             }
             if ($show_details == "yes") {
                 $post_item .= '<div class="comments-likes">';
                 if ($post_format == "quote" || $post_format == "link") {
                     if ($single_author && !$remove_dates) {
                         $post_item .= '<div class="blog-item-details">' . sprintf(__('%1$s', 'swiftframework'), $post_date) . '</div>';
                     } else {
                         if (!$remove_dates) {
                             $post_item .= '<div class="blog-item-details">' . sprintf(__('By <a href="%2$s" rel="author" itemprop="author">%1$s</a> on %3$s', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_date) . '</div>';
                         } else {
                             if (!$single_author) {
                                 $post_item .= '<div class="blog-item-details">' . sprintf(__('By <a href="%2$s" rel="author" itemprop="author">%1$s</a>', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID'))) . '</div>';
                             }
                         }
                     }
                 }
                 if (comments_open()) {
                     $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area"><i class="ss-chat"></i><span>' . $post_comments . '</span></a></div>';
                 }
                 if (function_exists('lip_love_it_link')) {
                     $post_item .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false);
                 }
                 $post_item .= '</div>';
             }
             $post_item .= '<meta itemprop="datePublished" content="' . get_the_date('Y-m-d') . '"/>';
             $post_item .= '</div>';
             // close standard-post-content
         }
     }
     return $post_item;
 }
Пример #12
0
 function sf_portfolio_thumbnail($display_type = "gallery", $multi_size = "", $multi_size_ratio = "1/1", $columns = "2", $hover_show_excerpt = "no", $excerpt_length = 20, $gutters = "yes", $fullwidth = "no")
 {
     global $post, $sf_options;
     $portfolio_thumb = $thumb_image_id = $thumb_image = $thumb_gallery = $video = $item_class = $link_config = $port_hover_style = $port_hover_text_style = '';
     $thumb_width = 400;
     $thumb_height = 300;
     $video_height = 300;
     if ($columns == "1") {
         $thumb_width = 1200;
         $thumb_height = 900;
         $video_height = 900;
     } else {
         if ($columns == "2") {
             $thumb_width = 800;
             $thumb_height = 600;
             $video_height = 600;
         } else {
             if ($columns == "3" || $columns == "4") {
                 if ($fullwidth == "yes") {
                     $thumb_width = 500;
                     $thumb_height = 375;
                     $video_height = 375;
                 } else {
                     $thumb_width = 400;
                     $thumb_height = 300;
                     $video_height = 300;
                 }
             }
         }
     }
     if ($display_type == "multi-size-masonry") {
         if ($multi_size_ratio == "4/3") {
             if ($multi_size == "wide-tall") {
                 $thumb_width = 1000;
                 $thumb_height = 750;
             } else {
                 if ($multi_size == "tall") {
                     $thumb_width = 500;
                     $thumb_height = 750;
                 } else {
                     if ($multi_size == "wide") {
                         $thumb_width = 1000;
                         $thumb_height = 375;
                     } else {
                         if ($multi_size == "standard") {
                             $thumb_width = 500;
                             $thumb_height = 375;
                             $video_height = 375;
                         }
                     }
                 }
             }
         } else {
             if ($multi_size == "wide-tall") {
                 $thumb_width = 900;
                 $thumb_height = 900;
             } else {
                 if ($multi_size == "tall") {
                     $thumb_width = 450;
                     $thumb_height = 900;
                 } else {
                     if ($multi_size == "wide") {
                         $thumb_width = 900;
                         $thumb_height = 450;
                     } else {
                         if ($multi_size == "standard") {
                             $thumb_width = 450;
                             $thumb_height = 450;
                             $video_height = 450;
                         }
                     }
                 }
             }
         }
         if ($gutters == "yes" && $multi_size == "tall") {
             $thumb_height = $thumb_height + 50;
         }
         if ($gutters == "yes" && $multi_size == "wide-tall") {
             $thumb_height = $thumb_height + 15;
         }
     }
     if ($display_type == "masonry" || $display_type == "masonry-gallery") {
         $thumb_height = null;
     }
     $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);
     if ($display_type == "multi-size-masonry" && $multi_size != "") {
         $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=large-square');
     } else {
         if ($columns == "2") {
             $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image-twocol');
         } else {
             $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);
     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 . ';"';
     }
     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');
     }
     $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
     $image_alt = esc_attr(sf_get_post_meta($thumb_image_id, '_wp_attachment_image_alt', true));
     $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();
     $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
     $post_excerpt = '';
     if ($custom_excerpt != '') {
         $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
     } else {
         $post_excerpt = sf_excerpt($excerpt_length);
     }
     if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "multi-size-masonry") {
         $portfolio_thumb .= '<figure class="animated-overlay overlay-style">' . "\n";
     } else {
         $portfolio_thumb .= '<figure class="animated-overlay overlay-alt">' . "\n";
     }
     if ($thumb_type == "video") {
         $video = sf_video_embed($thumb_video, $thumb_width, $video_height);
         $portfolio_thumb .= '<div class="video-thumb">' . $video . '</div>';
     } else {
         if ($thumb_type == "slider") {
             $portfolio_thumb .= '<div class="flexslider thumb-slider"><ul class="slides">' . "\n";
             foreach ($thumb_gallery as $image) {
                 $portfolio_thumb .= "<li><a " . $item_link['config'] . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>" . "\n";
             }
             $portfolio_thumb .= '</ul></div>' . "\n";
         } else {
             if ($thumb_type == "image" && $thumb_img_url == "") {
                 $thumb_img_url = "default";
             }
             $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
             if ($image) {
                 $portfolio_thumb .= '<a ' . $item_link['config'] . '></a>';
                 if ($display_type == "multi-size-masonry") {
                     $portfolio_thumb .= '<div class="multi-masonry-img-wrap"><img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" /></div>' . "\n";
                 } else {
                     $portfolio_thumb .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" />' . "\n";
                 }
                 $portfolio_thumb .= '<div class="figcaption-wrap"></div>';
                 if ($item_subtitle != "" && $hover_show_excerpt == "no" && ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "multi-size-masonry")) {
                     $portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info">';
                 } else {
                     if ($display_type == "standard" || $display_type == "masonry") {
                         $portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info thumb-info-alt">';
                     } else {
                         if ($hover_show_excerpt == "yes" && ($display_type == "gallery" || $display_type == "masonry-gallery")) {
                             $portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info thumb-info-excerpt">';
                         } else {
                             $portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info">';
                         }
                     }
                 }
                 if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "multi-size-masonry") {
                     if ($hover_show_excerpt == "yes") {
                         $portfolio_thumb .= '<h4 itemprop="name headline" ' . $port_hover_text_style . '>' . $item_title . '</h4>';
                         if ($post_excerpt != "") {
                             $portfolio_thumb .= '<div class="name-divide"></div>';
                             $portfolio_thumb .= '<div itemprop="description" ' . $port_hover_text_style . '>' . $post_excerpt . '</div>';
                         }
                     } else {
                         $portfolio_thumb .= '<h4 itemprop="name headline" ' . $port_hover_text_style . '>' . $item_title . '</h4>';
                         if ($item_subtitle != "") {
                             $portfolio_thumb .= '<div class="name-divide"></div>';
                             $portfolio_thumb .= '<h5 itemprop="name alternativeHeadline" ' . $port_hover_text_style . '>' . $item_subtitle . '</h5>';
                         }
                     }
                 } else {
                     $portfolio_thumb .= '<i class="' . $item_link['icon'] . '"></i>';
                 }
                 $portfolio_thumb .= '</div></figcaption>';
             }
         }
     }
     $portfolio_thumb .= '</figure>' . "\n";
     return $portfolio_thumb;
 }
 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;
 }