public function content($atts, $content = null) { $title = $el_class = $text_color = $image_url = $image_object = $width = $el_position = ''; extract(shortcode_atts(array('title' => '', 'character' => '', 'image' => '', 'animation' => '', 'animation_delay' => '', 'box_type' => '', 'color' => '', 'link' => '', 'target' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts)); $output = ''; if ($image != "") { $img_url = wp_get_attachment_url($image, 'full'); $image_oject = array(); if (function_exists('sf_aq_resize')) { $image_object = sf_aq_resize($img_url, 70, 70, true, false); } $image_url = $image_object[0]; } $icon_box_output = do_shortcode('[sf_iconbox character="' . $character . '" image="' . $image . '" color="standard" type="' . $box_type . '" title="' . $title . '" animation="' . $animation . '" animation_delay="' . $animation_delay . '" color="' . $color . '" link="' . $link . '" target="' . $target . '"]' . $content . '[/sf_iconbox]'); $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="spb_icon_box ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper box-wrap">'; $output .= "\n\t\t\t" . $icon_box_output; $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_carousel = true; return $output; }
if (version_compare(WOOCOMMERCE_VERSION, "2.0.0") >= 0) { $attachment_ids = $product->get_gallery_attachment_ids(); if ($attachment_ids) { foreach ($attachment_ids as $attachment_id) { $classes = array('zoom'); if ($loop == 0 || $loop % $columns == 0) { $classes[] = 'first'; } if (($loop + 1) % $columns == 0) { $classes[] = 'last'; } $image_link = wp_get_attachment_url($attachment_id); if (!$image_link) { continue; } $image = sf_aq_resize($image_link, 562, NULL, true, false); $image_class = esc_attr(implode(' ', $classes)); $image_title = esc_attr(get_the_title($attachment_id)); $image_alt = esc_attr(sf_get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)); if ($image) { $image_html = '<img class="product-slider-image" data-zoom-image="' . $image_link . '" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" title="' . $image_title . '" />'; echo apply_filters('woocommerce_single_product_image_thumbnail_html', sprintf('<li>%s<a href="%s" class="%s" title="%s" alt="%s" data-rel="prettyPhoto[product-gallery]"><i class="ss-expand"></i></a></li>', $image_html, $image_link, $image_class, $image_title, $image_alt), $attachment_id, $post->ID, $image_class); } $loop++; } } } else { $attachment_ids = get_posts(array('post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID, 'post__not_in' => array(get_post_thumbnail_id()), 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC')); if ($attachment_ids) { $loop = 0; $columns = apply_filters('woocommerce_product_thumbnails_columns', 3);
public function content($atts, $content = null) { $title = $order = $text_size = $items = $el_class = $width = $el_position = ''; extract(shortcode_atts(array('title' => '', 'text_size' => '', 'item_count' => '', 'order' => '', 'category' => 'all', 'animation' => 'fade', 'autoplay' => 'yes', 'el_class' => '', 'alt_background' => 'none', 'el_position' => '', 'width' => '1/1'), $atts)); $output = ''; // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); // TESTIMONIAL QUERY SETUP global $post, $wp_query; $paged = get_query_var('paged') ? get_query_var('paged') : 1; $testimonials_args = array('orderby' => $order, 'post_type' => 'testimonials', 'post_status' => 'publish', 'paged' => $paged, 'testimonials-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1); $testimonials = new WP_Query($testimonials_args); if ($autoplay == "yes") { $items .= '<div class="flexslider testimonials-slider content-slider" data-animation="' . $animation . '" data-autoplay="yes"><ul class="slides">'; } else { $items .= '<div class="flexslider testimonials-slider content-slider" data-animation="' . $animation . '" data-autoplay="no"><ul class="slides">'; } // TESTIMONIAL LOOP while ($testimonials->have_posts()) { $testimonials->the_post(); $testimonial_text = get_the_content(); $testimonial_cite = sf_get_post_meta($post->ID, 'sf_testimonial_cite', true); $testimonial_cite_subtext = sf_get_post_meta($post->ID, 'sf_testimonial_cite_subtext', true); $testimonial_image = rwmb_meta('sf_testimonial_cite_image', 'type=image', $post->ID); foreach ($testimonial_image as $detail_image) { $testimonial_image_url = $detail_image['url']; break; } if (!$testimonial_image) { $testimonial_image = get_post_thumbnail_id(); $testimonial_image_url = wp_get_attachment_url($testimonial_image, 'full'); } $testimonial_image = sf_aq_resize($testimonial_image_url, 70, 70, true, false); $items .= '<li class="testimonial">'; $items .= '<div class="testimonial-text text-' . $text_size . '">' . do_shortcode($testimonial_text) . '</div>'; if ($testimonial_image) { $items .= '<div class="testimonial-cite has-image">'; $items .= '<img src="' . $testimonial_image[0] . '" width="' . $testimonial_image[1] . '" height="' . $testimonial_image[2] . '" alt="' . $testimonial_cite . '" />'; if ($testimonial_cite_subtext != "") { $items .= '<cite>' . $testimonial_cite . '<span>' . $testimonial_cite_subtext . '</span></cite>'; } else { $items .= '<cite>' . $testimonial_cite . '</cite>'; } } else { $items .= '<div class="testimonial-cite">'; if ($testimonial_cite_subtext != "") { $items .= '<cite>' . $testimonial_cite . '<span>' . $testimonial_cite_subtext . '</span></cite>'; } else { $items .= '<cite>' . $testimonial_cite . '</cite>'; } } $items .= '</div>'; $items .= '</li>'; } wp_reset_postdata(); $items .= '</ul></div>'; $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true); $sidebars = ''; if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") { $sidebars = 'one-sidebar'; } else { if ($sidebar_config == "both-sidebars") { $sidebars = 'both-sidebars'; } else { $sidebars = 'no-sidebars'; } } $el_class .= ' testimonial'; // Full width setup $fullwidth = false; if ($alt_background != "none") { $fullwidth = true; } $output .= "\n\t" . '<div class="spb_testimonial_slider_widget spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper slider-wrap">'; $output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading spb-center-heading"><span>' . $title . '</span></h3></div>' : ''; $output .= "\n\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, $width, $fullwidth, false, $alt_background) . $output . $this->endRow($el_position, $width, $fullwidth, false); global $sf_include_carousel; $sf_include_carousel = true; return $output; }
function sf_mini_product_items($asset_type, $category, $item_count, $sidebar_config, $width) { global $woocommerce, $sf_catalog_mode; $product_list_output = $image = ""; $args = array(); // ARRAY ARGUMENTS if ($asset_type == "latest-products") { $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count); $args['meta_query'] = array(); $args['meta_query'][] = $woocommerce->query->stock_status_meta_query(); $args['meta_query'][] = $woocommerce->query->visibility_meta_query(); } else { if ($asset_type == "featured-products") { $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'meta_key' => '_featured', 'meta_value' => 'yes', 'posts_per_page' => $item_count); } else { if ($asset_type == "top-rated") { add_filter('posts_clauses', array($woocommerce->query, 'order_by_rating_post_clauses')); $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count); $args['meta_query'] = $woocommerce->query->get_meta_query(); } else { if ($asset_type == "recently-viewed") { // Get recently viewed product cookies data $viewed_products = !empty($_COOKIE['woocommerce_recently_viewed']) ? (array) explode('|', $_COOKIE['woocommerce_recently_viewed']) : array(); $viewed_products = array_filter(array_map('absint', $viewed_products)); // If no data, quit if (empty($viewed_products)) { return '<p class="no-products">' . __("You haven't viewed any products yet.", "swiftframework") . '</p>'; } // Create query arguments array $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count, 'no_found_rows' => 1, 'post__in' => $viewed_products, 'orderby' => 'rand'); // Add meta_query to query args //$args['meta_query'] = array(); // Check products stock status //$args['meta_query'][] = $woocommerce->query->stock_status_meta_query(); } else { if ($asset_type == "sale-products") { // Get products on sale $product_ids_on_sale = wc_get_product_ids_on_sale(); $meta_query = array(); $meta_query[] = WC()->query->visibility_meta_query(); $meta_query[] = WC()->query->stock_status_meta_query(); $meta_query = array_filter($meta_query); $args = array('product_cat' => $category, 'posts_per_page' => $item_count, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product', 'meta_query' => $meta_query, 'post__in' => array_merge(array(0), $product_ids_on_sale)); } else { $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count, 'meta_key' => 'total_sales', 'orderby' => 'meta_value_num', 'meta_query' => array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN'))); $args['meta_query'] = array(); $args['meta_query'][] = $woocommerce->query->stock_status_meta_query(); $args['meta_query'][] = $woocommerce->query->visibility_meta_query(); } } } } } // OUTPUT PRODUCTS $products = new WP_Query($args); if ($products->have_posts()) { $product_list_output .= '<ul class="mini-list mini-' . $asset_type . '">'; while ($products->have_posts()) { $products->the_post(); $product_output = $rating_output = ""; global $product, $post, $wpdb, $woocommerce_loop; // Ensure visibility if (!$product->is_visible()) { return; } if (has_post_thumbnail()) { $image_title = esc_attr(get_the_title(get_post_thumbnail_id())); $image_alt = esc_attr(sf_get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)); $image_link = wp_get_attachment_url(get_post_thumbnail_id()); if ($image_link == "") { $image_link = "default"; } $image = sf_aq_resize($image_link, 70, 70, true, false); if ($image) { $image_html = '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" title="' . $image_title . '" alt="' . $image_alt . '" />'; } } if (comments_open()) { $count = $wpdb->get_var("\n\t\t \t\t SELECT COUNT(meta_value) FROM {$wpdb->commentmeta}\n\t\t \t\t LEFT JOIN {$wpdb->comments} ON {$wpdb->commentmeta}.comment_id = {$wpdb->comments}.comment_ID\n\t\t \t\t WHERE meta_key = 'rating'\n\t\t \t\t AND comment_post_ID = {$post->ID}\n\t\t \t\t AND comment_approved = '1'\n\t\t \t\t AND meta_value > 0\n\t\t \t\t"); $rating = $wpdb->get_var("\n\t\t \t SELECT SUM(meta_value) FROM {$wpdb->commentmeta}\n\t\t \t LEFT JOIN {$wpdb->comments} ON {$wpdb->commentmeta}.comment_id = {$wpdb->comments}.comment_ID\n\t\t \t WHERE meta_key = 'rating'\n\t\t \t AND comment_post_ID = {$post->ID}\n\t\t \t AND comment_approved = '1'\n\t\t \t "); if ($count > 0) { $average = number_format($rating / $count, 2); $rating_output = '<div class="star-rating" title="' . sprintf(__('Rated %s out of 5', 'swiftframework'), $average) . '" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span style="width:' . $average * 16 . 'px"><span itemprop="ratingValue" class="rating">' . $average . '</span> ' . __('out of 5', 'swiftframework') . '</span></div>'; } } $product_output .= '<li class="clearfix" itemscope itemtype="http://schema.org/Product">'; if ($image) { $product_output .= '<figure>'; $product_output .= '<a href="' . get_permalink($post->ID) . '">'; $product_output .= $image_html; $product_output .= '</a>'; $product_output .= '</figure>'; } $product_output .= '<div class="product-details">'; $product_output .= '<h5 itemprop="name"><a href="' . get_permalink($post->ID) . '">' . get_the_title() . '</a></h5>'; if ($asset_type == "top-rated") { $product_output .= $rating_output; } else { $size = sizeof(get_the_terms($post->ID, 'product_cat')); $product_output .= $product->get_categories(', ', '<span class="product-cats">', '</span>'); } if (!$sf_catalog_mode) { $product_output .= '<span class="price" itemprop="price">' . $product->get_price_html() . '</span>'; } $product_output .= '</div>'; $product_output .= '</li>'; $product_list_output .= $product_output; } wp_reset_query(); wp_reset_postdata(); remove_filter('posts_clauses', array($woocommerce->query, 'order_by_rating_post_clauses')); $product_list_output .= '</ul>'; return $product_list_output; } }
function widget($args, $instance) { global $post; extract($args); // Widget Options $title = apply_filters('widget_title', $instance['title']); // Title $number = $instance['number']; // Number of posts to show $category = $instance['category']; // Category to show if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $recent_portfolio = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => $number, 'portfolio-category' => $category_slug)); $count = 0; if ($recent_portfolio->have_posts()) { ?> <ul class="portfolio-grid"> <?php while ($recent_portfolio->have_posts()) { $recent_portfolio->the_post(); $post_title = get_the_title(); $post_permalink = get_permalink(); $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full'); foreach ($thumb_image as $detail_image) { $thumb_img_url = $detail_image['url']; break; } if (!$thumb_image) { $thumb_image = get_post_thumbnail_id(); $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); } $image = sf_aq_resize($thumb_img_url, 85, 85, true, false); ?> <?php if ($image) { ?> <li class="grid-item-<?php echo $count; ?> "> <a href="<?php echo $post_permalink; ?> " class="grid-image"> <img src="<?php echo $image[0]; ?> " width="<?php echo $image[1]; ?> " height="<?php echo $image[2]; ?> " alt="<?php echo $post_title; ?> " /> <span class="tooltip"><?php echo $post_title; ?> <span class="arrow"></span></span> </a> </li> <?php } ?> <?php $count++; wp_reset_query(); } ?> </ul> <?php } ?> <?php echo $after_widget; }
function sf_portfolio_related() { global $post; $related = sf_portfolio_related_posts($post->ID); if ($related->have_posts()) { ?> <div class="container"> <div class="related-projects clearfix"> <h3 class="spb-heading"><span><?php _e("Related Projects", "swiftframework"); ?> </span></h3> <ul class="row"> <?php while ($related->have_posts()) { $related->the_post(); ?> <?php $item_title = get_the_title(); $thumb_image = ""; $thumb_image = sf_get_post_meta($post->ID, 'sf_thumbnail_image', true); if ($thumb_image == "") { $thumb_image = get_post_thumbnail_id($post->ID); } $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); if ($thumb_img_url == "") { $thumb_img_url = "default"; } $image = sf_aq_resize($thumb_img_url, 300, 225, true, false); ?> <li class="col-sm-3"> <figure class="animated-overlay"> <img src="<?php echo $image[0]; ?> " width="<?php echo $image[1]; ?> " height="<?php echo $image[2]; ?> " alt="<?php echo $item_title; ?> " /> <a href="<?php the_permalink(); ?> "></a> <figcaption> <div class="thumb-info"> <h4><?php echo $item_title; ?> </h4> <i class="ss-navigateright"></i> </div> </figcaption> </figure> </li> <?php } ?> </ul> </div> </div> <?php } ?> <?php }
<?php while ($related->have_posts()) { $related->the_post(); ?> <?php $item_title = get_the_title(); $thumb_image = ""; $thumb_image = sf_get_post_meta($post->ID, 'sf_thumbnail_image', true); if ($thumb_image == "") { $thumb_image = get_post_thumbnail_id($post->ID); } $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); if ($thumb_img_url == "") { $thumb_img_url = "default"; } $image = sf_aq_resize($thumb_img_url, 300, 225, true, false); ?> <li class="col-sm-3"> <figure class="animated-overlay"> <img src="<?php echo $image[0]; ?> " width="<?php echo $image[1]; ?> " height="<?php echo $image[2]; ?> " alt="<?php echo $item_title;
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_nextprev_navigation() { global $sf_options; // Pagiantion style $pagination_style = "standard"; if (isset($sf_options['pagination_style'])) { $pagination_style = $sf_options['pagination_style']; } // Portfolio category navigation $enable_category_navigation = $sf_options['enable_category_navigation']; if (!(is_singular('post') || is_singular('portfolio') || is_singular('product')) || $pagination_style != "fs-arrow" || !sf_theme_supports('fullscreen-pagination')) { return; } $taxonomy = "category"; if (is_singular('portfolio')) { $taxonomy = "portfolio-category"; } else { if (is_singular('product')) { $taxonomy = "product_cat"; } } // Get next/prev post $prev_post = get_next_post($enable_category_navigation, '', $taxonomy); $next_post = get_previous_post($enable_category_navigation, '', $taxonomy); $sf_prev_icon = apply_filters('sf_prev_icon', '<i class="ss-navigateleft"></i>'); $sf_next_icon = apply_filters('sf_next_icon', '<i class="ss-navigateright"></i>'); if (!empty($prev_post)) { $postID = $prev_post->ID; $prev_permalink = get_permalink($postID); $item_subtitle = sf_get_post_meta($postID, 'sf_portfolio_subtitle', true); $use_thumb_content = sf_get_post_meta($postID, 'sf_thumbnail_content_main_detail', true); $image = $media_image_url = $image_id = ""; if ($use_thumb_content) { $media_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $postID); } else { $media_image = rwmb_meta('sf_detail_image', 'type=image&size=full', $postID); } foreach ($media_image as $detail_image) { $image_id = $detail_image['ID']; $media_image_url = $detail_image['url']; break; } if (!$media_image) { $media_image = get_post_thumbnail_id($postID); $image_id = $media_image; $media_image_url = wp_get_attachment_url($media_image, 'full'); } $detail_image = sf_aq_resize($media_image_url, 80, 80, true, false); $image_alt = sf_get_post_meta($image_id, '_wp_attachment_image_alt', true); if ($detail_image) { $image = '<img itemprop="image" src="' . $detail_image[0] . '" width="' . $detail_image[1] . '" height="' . $detail_image[2] . '" alt="' . $image_alt . '" />'; } ?> <?php if ($image != "") { ?> <div id="prev-article-pagination" class="window-arrow-nav prev-item has-img"> <?php } else { ?> <div id="prev-article-pagination" class="window-arrow-nav prev-item"> <?php } ?> <a href="<?php echo esc_url($prev_permalink); ?> "> <div class="nav-transition"> <div class="overlay-wrap"> <?php echo esc_html($sf_prev_icon); ?> <?php if ($image != "") { ?> <figure class="pagination-article-image"> <?php echo esc_html($image); ?> </figure> <?php } ?> </div> </div> <?php if ($item_subtitle != "") { ?> <div class="pagination-article-details has-subtitle"> <h5><?php echo esc_attr($prev_post->post_title); ?> </h5> <p><?php echo esc_attr($item_subtitle); ?> </p> <?php } else { ?> <div class="pagination-article-details no-subtitle"> <h5><?php echo esc_attr($prev_post->post_title); ?> </h5> <?php } ?> </div> </a> </div> <?php } if (!empty($next_post)) { $postID = $next_post->ID; $next_permalink = get_permalink($postID); $item_subtitle = sf_get_post_meta($postID, 'sf_portfolio_subtitle', true); $use_thumb_content = sf_get_post_meta($postID, 'sf_thumbnail_content_main_detail', true); $image = $media_image_url = $image_id = ""; if ($use_thumb_content) { $media_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $postID); } else { $media_image = rwmb_meta('sf_detail_image', 'type=image&size=full', $postID); } foreach ($media_image as $detail_image) { $image_id = $detail_image['ID']; $media_image_url = $detail_image['url']; break; } if (!$media_image) { $media_image = get_post_thumbnail_id($postID); $image_id = $media_image; $media_image_url = wp_get_attachment_url($media_image, 'full'); } $detail_image = sf_aq_resize($media_image_url, 80, 80, true, false); $image_alt = sf_get_post_meta($image_id, '_wp_attachment_image_alt', true); if ($detail_image) { $image = '<img itemprop="image" src="' . $detail_image[0] . '" width="' . $detail_image[1] . '" height="' . $detail_image[2] . '" alt="' . $image_alt . '" />'; } ?> <?php if ($image != "") { ?> <div id="next-article-pagination" class="window-arrow-nav next-item has-img"> <?php } else { ?> <div id="next-article-pagination" class="window-arrow-nav next-item"> <?php } ?> <a href="<?php echo esc_url($next_permalink); ?> "> <div class="nav-transition"> <div class="overlay-wrap"> <?php echo esc_html($sf_next_icon); ?> <?php if ($image != "") { ?> <figure class="pagination-article-image"> <?php echo esc_html($image); ?> </figure> <?php } ?> </div> </div> <?php if ($item_subtitle != "") { ?> <div class="pagination-article-details has-subtitle"> <h5><?php echo esc_attr($next_post->post_title); ?> </h5> <p><?php echo esc_attr($item_subtitle); ?> </p> <?php } else { ?> <div class="pagination-article-details no-subtitle"> <h5><?php echo esc_attr($next_post->post_title); ?> </h5> <?php } ?> </div> </a> </div> <?php } }
function sf_get_search_item($postID) { $search_item = $thumb_img_url = $post_excerpt = $img_icon = ""; $post_format = get_post_format($postID); if ($post_format == "") { $post_format = 'standard'; } $post_type = get_post_type($postID); if ($post_type == "post") { if ($post_format == "quote" || $post_format == "status") { $img_icon = "ss-quote"; } else { if ($post_format == "image") { $img_icon = "ss-picture"; } else { if ($post_format == "chat") { $img_icon = "ss-chat"; } else { if ($post_format == "audio") { $img_icon = "ss-music"; } else { if ($post_format == "video") { $img_icon = "ss-video"; } else { if ($post_format == "link") { $img_icon = "ss-link"; } else { $img_icon = "ss-pen"; } } } } } } } else { if ($post_type == "product") { $img_icon = "ss-cart"; } else { if ($post_type == "portfolio") { $img_icon = "ss-picture"; } else { if ($post_type == "team") { $img_icon = "ss-user"; } else { if ($post_type == "galleries") { $img_icon = "ss-picture"; } else { $img_icon = "ss-file"; } } } } } $post_title = get_the_title(); $post_date = get_the_date(); $post_permalink = get_permalink(); $custom_excerpt = sf_get_post_meta($postID, 'sf_custom_excerpt', true); $post_excerpt = strip_shortcodes(get_the_excerpt()); $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=thumbnail'); 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, 'thumbnail'); } $image = sf_aq_resize($thumb_img_url, 70, 70, true, false); $image_title = sf_featured_img_title(); if ($image) { $search_item .= '<div class="search-item-img"><a href="' . $post_permalink . '"><img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_title . '" /></a></div>'; } else { $search_item .= '<div class="search-item-img"><a href="' . $post_permalink . '" class="img-holder"><i class="' . $img_icon . '"></i></a></div>'; } if ($post_excerpt == "<p></p>") { $search_item .= '<div class="search-item-content no-excerpt">'; $search_item .= '<h3><a href="' . $post_permalink . '">' . $post_title . '</a></h3>'; $search_item .= '<time>' . $post_date . '</time>'; $search_item .= '</div>'; } else { $search_item .= '<div class="search-item-content">'; $search_item .= '<h3><a href="' . $post_permalink . '">' . $post_title . '</a></h3>'; $search_item .= '<time>' . $post_date . '</time>'; $search_item .= '<div class="excerpt">' . $post_excerpt . '</div>'; $search_item .= '</div>'; } return $search_item; }
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; }
protected function content($atts, $content = null) { $title = $show_hide = $width = $item_class = $el_class = $output = $filter = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', "category" => 'all', 'excerpt_length' => '60', '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++; } $args = array('post_type' => 'team', 'post_status' => 'publish', 'team-category' => $category_slug, 'posts_per_page' => -1, 'ignore_sticky_posts' => 1, 'no_found_rows' => 1); $team_members = query_posts($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; } } } $list_class = ''; if ($show_hide == "yes") { $list_class = 'has-show-hide'; } if (have_posts()) { $items .= '<div class="carousel-overflow"><ul id="carousel-' . $sf_carouselID . '" class="team-members carousel-items ' . $list_class . ' clearfix" data-columns="' . $columns . '" data-auto="false">'; while (have_posts()) { the_post(); $member_name = get_the_title(); $member_position = sf_get_post_meta($post->ID, 'sf_team_member_position', true); $member_bio = sf_excerpt($excerpt_length); $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true); if ($custom_excerpt != "") { $member_bio = sf_custom_excerpt($custom_excerpt, 1000); } $member_twitter = sf_get_post_meta($post->ID, 'sf_team_member_twitter', true); $member_facebook = sf_get_post_meta($post->ID, 'sf_team_member_facebook', true); $member_linkedin = sf_get_post_meta($post->ID, 'sf_team_member_linkedin', true); $member_google_plus = sf_get_post_meta($post->ID, 'sf_team_member_google_plus', true); $member_skype = sf_get_post_meta($post->ID, 'sf_team_member_skype', true); $member_instagram = sf_get_post_meta($post->ID, 'sf_team_member_instagram', true); $member_dribbble = sf_get_post_meta($post->ID, 'sf_team_member_dribbble', true); $member_image = get_post_thumbnail_id(); $items .= '<li itemscope data-id="id-' . $count . '" class="clearfix carousel-item team-member ' . $item_class . '">'; $img_url = wp_get_attachment_url($member_image, 'full'); $image = sf_aq_resize($img_url, 270, 270, true, false); $items .= '<figure class="standard-style">'; if ($image) { $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />'; } if ($member_twitter != "" || $member_facebook != "" || $member_linkedin != "" || $member_google_plus != "" || $member_skype != "" || $member_instagram != "" || $member_dribbble != "") { $items .= '<figcaption><span>' . __("Follow:", "swiftframework") . '</span><ul class="social-icons">'; if ($member_twitter != "") { $items .= '<li class="twitter"><a href="http://www.twitter.com/' . $member_twitter . '" target="_blank"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></li>'; } if ($member_facebook != "") { $items .= '<li class="facebook"><a href="' . $member_facebook . '" target="_blank"><i class="fa-facebook"></i><i class="fa-facebook"></i></a></li>'; } if ($member_linkedin != "") { $items .= '<li class="linkedin"><a href="' . $member_linkedin . '" target="_blank"><i class="fa-linkedin"></i><i class="fa-linkedin"></i></a></li>'; } if ($member_google_plus != "") { $items .= '<li class="googleplus"><a href="' . $member_google_plus . '" target="_blank"><i class="fa-google-plus"></i><i class="fa-google-plus"></i></a></li>'; } if ($member_skype != "") { $items .= '<li class="skype"><a href="skype:' . $member_skype . '" target="_blank"><i class="fa-skype"></i><i class="fa-skype"></i></a></li>'; } if ($member_instagram != "") { $items .= '<li class="instagram"><a href="' . $member_instagram . '" target="_blank"><i class="fa-instagram"></i><i class="fa-instagram"></i></a></li>'; } if ($member_dribbble != "") { $items .= '<li class="dribbble"><a href="http://www.dribbble.com/' . $member_dribbble . '" target="_blank"><i class="fa-dribbble"></i><i class="fa-dribbble"></i></a></li>'; } $items .= '</ul></figcaption>'; } $items .= '</figure>'; $items .= '<h5 class="team-member-name"><a href="' . get_permalink() . '">' . $member_name . '</a></h5>'; $items .= '<h5 class="team-member-position">' . $member_position . '</h5>'; $items .= '<div class="team-member-details-wrap">'; $items .= '<div class="team-member-bio">' . $member_bio . '<a href="' . get_permalink() . '" class="read-more">' . __("View profile", "swiftframework") . '</a></div>'; $items .= '</div>'; $items .= '</li>'; $count++; } wp_reset_query(); $items .= '</ul>'; $items .= '<a href="#" class="prev"><i class="ss-navigateleft"></i></a><a href="#" class="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_team_carousel_widget spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper carousel-wrap">'; if ($title != '') { $output .= "\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); global $sf_include_carousel, $sf_include_isotope; $sf_include_carousel = true; $sf_include_isotope = true; return $output; }
function sf_get_wishlist() { global $wpdb, $yith_wcwl, $woocommerce; $wishlist_output = ""; if (is_user_logged_in()) { $user_id = get_current_user_id(); } $count = array(); if (is_user_logged_in()) { $count = $wpdb->get_results($wpdb->prepare('SELECT COUNT(*) as `cnt` FROM `' . YITH_WCWL_TABLE . '` WHERE `user_id` = %d', $user_id), ARRAY_A); $count = $count[0]['cnt']; } elseif (yith_usecookies()) { $count[0]['cnt'] = count(yith_getcookie('yith_wcwl_products')); $count = $count[0]['cnt']; } else { $count[0]['cnt'] = count($_SESSION['yith_wcwl_products']); $count = $count[0]['cnt']; } if (is_array($count)) { $count = 0; } $wishlist_output .= '<li class="parent wishlist-item"><a class="wishlist-link" href="' . $yith_wcwl->get_wishlist_url() . '" title="' . __("View your wishlist", "swiftframework") . '"><i class="ss-star"></i><span>' . $count . '</span></a>'; $wishlist_output .= '<ul class="sub-menu">'; $wishlist_output .= '<li>'; $wishlist_output .= '<div class="wishlist-bag">'; $current_page = 1; $limit_sql = ''; $count_limit = 0; if (is_user_logged_in()) { $wishlist = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . YITH_WCWL_TABLE . "` WHERE `user_id` = %s" . $limit_sql, $user_id), ARRAY_A); } elseif (yith_usecookies()) { $wishlist = yith_getcookie('yith_wcwl_products'); } else { $wishlist = isset($_SESSION['yith_wcwl_products']) ? $_SESSION['yith_wcwl_products'] : array(); } do_action('yith_wcwl_before_wishlist_title'); $wishlist_title = get_option('yith_wcwl_wishlist_title'); if (!empty($wishlist_title)) { $wishlist_output .= '<div class="bag-header">' . $wishlist_title . '</div>'; } $wishlist_output .= '<div class="bag-contents">'; $wishlist_output .= do_action('yith_wcwl_before_wishlist'); if (count($wishlist) > 0) { foreach ($wishlist as $values) { if ($count_limit < 4) { if (!is_user_logged_in()) { if (isset($values['add-to-wishlist']) && is_numeric($values['add-to-wishlist'])) { $values['prod_id'] = $values['add-to-wishlist']; $values['ID'] = $values['add-to-wishlist']; } else { $values['prod_id'] = $values['product_id']; $values['ID'] = $values['product_id']; } } $product_obj = get_product($values['prod_id']); if ($product_obj !== false && $product_obj->exists()) { $wishlist_output .= '<div id="wishlist-' . $values['ID'] . '" class="bag-product clearfix">'; if (has_post_thumbnail($product_obj->id)) { $image_link = wp_get_attachment_url(get_post_thumbnail_id($product_obj->id)); $image = sf_aq_resize($image_link, 70, 70, true, false); if ($image) { $wishlist_output .= '<figure><a class="bag-product-img" href="' . esc_url(get_permalink(apply_filters('woocommerce_in_cart_product', $values['prod_id']))) . '"><img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" /></a></figure>'; } } $wishlist_output .= '<div class="bag-product-details">'; $wishlist_output .= '<div class="bag-product-title"><a href="' . esc_url(get_permalink(apply_filters('woocommerce_in_cart_product', $values['prod_id']))) . '">' . apply_filters('woocommerce_in_cartproduct_obj_title', $product_obj->get_title(), $product_obj) . '</a></div>'; if (get_option('woocommerce_display_cart_prices_excluding_tax') == 'yes') { $wishlist_output .= '<div class="bag-product-price">' . apply_filters('woocommerce_cart_item_price_html', woocommerce_price($product_obj->get_price_excluding_tax()), $values, '') . '</div>'; } else { $wishlist_output .= '<div class="bag-product-price">' . apply_filters('woocommerce_cart_item_price_html', woocommerce_price($product_obj->get_price()), $values, '') . '</div>'; } $wishlist_output .= '</div>'; $wishlist_output .= '</div>'; } $count_limit++; } } } else { $wishlist_output .= '<div class="wishlist-empty">' . __('Your wishlist is currently empty.', 'swiftframework') . '</div>'; } $wishlist_output .= '</div>'; $wishlist_output .= '<div class="bag-buttons">'; $wishlist_output .= '<a class="sf-button standard sf-icon-reveal wishlist-button" href="' . $yith_wcwl->get_wishlist_url() . '"><i class="ss-star"></i><span class="text">' . __('Go to your wishlist', 'swiftframework') . '</span></a>'; $wishlist_output .= '</div>'; do_action('yith_wcwl_after_wishlist'); $wishlist_output .= '</div>'; $wishlist_output .= '</li>'; $wishlist_output .= '</ul>'; $wishlist_output .= '</li>'; return $wishlist_output; }
protected function content($atts, $content = null) { $title = $width = $el_class = $carousel = $item_class = $output = $tax_terms = $filter = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'item_columns' => '4', 'category' => '', 'carousel' => 'no', 'carousel_columns' => '', 'pagination' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts)); // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); // CLIENTS QUERY SETUP global $post, $wp_query, $sf_carouselID; if ($sf_carouselID == "") { $sf_carouselID = 1; } else { $sf_carouselID++; } $paged = get_query_var('paged') ? get_query_var('paged') : 1; $client_args = array('post_type' => 'clients', 'post_status' => 'publish', 'paged' => $paged, 'clients-category' => $category_slug, 'posts_per_page' => $item_count); $clients_items = new WP_Query($client_args); global $column_width; $client_width = 300; $client_height = 300; if ($item_columns == "5") { $item_class = 'col-sm-sf-5'; } else { if ($item_columns == "4") { $item_class = 'col-sm-3'; } else { if ($item_columns == "3") { $item_class = 'col-sm-4'; $client_width = 400; $client_height = 400; } } } if ($item_columns == "2") { $item_class = 'col-sm-6'; $client_width = 600; $client_height = 600; } if ($carousel == "yes") { $items .= '<div id="carousel-' . $sf_carouselID . '" class="clients-items carousel-items clearfix" data-columns="' . $item_columns . '">'; } else { $items .= '<div class="clients-items row clearfix">'; } // CLIENTS LOOP while ($clients_items->have_posts()) { $clients_items->the_post(); $client_image = get_post_thumbnail_id(); $client_img_url = wp_get_attachment_url($client_image, 'full'); $client_link_url = sf_get_post_meta($post->ID, 'sf_client_link', true); $image_alt = esc_attr(sf_get_post_meta($client_image, '_wp_attachment_image_alt', true)); if ($carousel == "yes") { $items .= '<div class="clearfix carousel-item">'; } else { $items .= '<div class="' . $item_class . ' client-item clearfix">'; } $items .= '<figure>'; $image = sf_aq_resize($client_img_url, $client_width, $client_height, true, false); if ($image) { if ($client_link_url) { $items .= '<a href="' . $client_link_url . '" target="_blank"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" /></a>'; } else { $items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" />'; } } $items .= '</figure>'; $items .= '</div>'; } wp_reset_query(); wp_reset_postdata(); $items .= '</div>'; // PAGINATION if ($pagination == "yes") { $items .= '<div class="pagination-wrap">'; $items .= pagenavi($clients_items); $items .= '</div>'; } // PAGE BUILDER OUPUT $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="spb_clients_widget clients-wrap carousel-asset spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb-asset-content">'; $output .= "\n\t\t" . '<div class="title-wrap clearfix">'; if ($title != '') { $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>'; } if ($carousel == "yes") { $output .= spb_carousel_arrows(); } $output .= '</div>'; $output .= "\n\t\t" . $items; $output .= "\n\t\t" . '</div>'; $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); $output = $this->startRow($el_position) . $output . $this->endRow($el_position); global $sf_include_carousel; $sf_include_carousel = true; return $output; }
function sf_portfolio_related_projects() { global $post, $sf_options; $fullwidth = $sf_options['related_projects_fullwidth']; $item_count = $sf_options['related_projects_columns']; $related = sf_portfolio_related_posts($post->ID, $item_count); $item_class = "col-sm-4"; $wrap_class = $heading_class = ""; if ($fullwidth) { $heading_class = "container"; } else { $wrap_class = "container"; } $hover_style = "default"; // Thumb Type if ($hover_style == "default" && function_exists('sf_get_thumb_type')) { $wrap_class .= ' ' . sf_get_thumb_type(); } else { $wrap_class .= ' thumbnail-' . $hover_style; } if ($item_count == "4") { $item_class = "col-sm-3"; } if ($related->have_posts()) { ?> <section class="related-projects <?php echo esc_attr($wrap_class); ?> clearfix"> <h2 class="<?php echo esc_attr($heading_class); ?> "><?php apply_filters('sf_related_projects_heading', _e("Related Projects", "swiftframework")); ?> </h2> <div class="clearfix"> <?php while ($related->have_posts()) { $related->the_post(); ?> <?php $item_title = get_the_title(); $item_subtitle = sf_get_post_meta($post->ID, 'sf_portfolio_subtitle', true); $thumb_image = $port_hover_style = $port_hover_text_style = ""; $thumb_image = sf_get_post_meta($post->ID, 'sf_thumbnail_image', true); if (!$thumb_image) { $thumb_image = get_post_thumbnail_id(); } $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); if ($thumb_img_url == "") { $thumb_img_url = "default"; } $image = sf_aq_resize($thumb_img_url, 500, 375, true, false); $image_alt = esc_attr(sf_get_post_meta($thumb_image, '_wp_attachment_image_alt', true)); $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 . ';"'; } ?> <article class="<?php echo esc_attr($item_class); ?> "> <figure class="animated-overlay overlay-style"> <img src="<?php echo esc_url($image[0]); ?> " width="<?php echo esc_attr($image[1]); ?> " height="<?php echo esc_attr($image[2]); ?> " alt="<?php echo esc_attr($image_alt); ?> "/> <a href="<?php the_permalink(); ?> "></a> <figcaption <?php echo esc_attr($port_hover_style); ?> > <div class="thumb-info"> <h4 <?php echo esc_attr($port_hover_text_style); ?> ><?php echo esc_attr($item_title); ?> </h4> <div class="name-divide"></div> <h5 <?php echo esc_attr($port_hover_text_style); ?> ><?php echo esc_attr($item_subtitle); ?> </h5> </div> </figcaption> </figure> </article> <?php } ?> </div> </section> <?php } }
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 $number = $instance['number']; // Number of posts to show $category = $instance['category']; // Category to show if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $video_icon = apply_filters('sf_video_icon', '<i class="ss-video"></i>'); $audio_icon = apply_filters('sf_audio_icon', '<i class="ss-music"></i>'); $picture_icon = apply_filters('sf_picture_icon', '<i class="ss-picture"></i>'); $post_icon = apply_filters('sf_post_icon', '<i class="ss-file"></i>'); $recent_posts = new WP_Query(array('post_type' => 'post', 'posts_per_page' => $number, 'category_name' => $category_slug)); $thumb_width = apply_filters('sf_widget_posts_thumb_width', 94); $thumb_height = apply_filters('sf_widget_posts_thumb_height', 75); if ($recent_posts->have_posts()) { ?> <ul class="recent-posts-list"> <?php while ($recent_posts->have_posts()) { $recent_posts->the_post(); $thumb_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true); $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(); $thumb_image = get_post_thumbnail_id(); $thumb_img_url = wp_get_attachment_url($thumb_image, 'widget-image'); $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false); $image_alt = esc_attr(sf_get_post_meta($thumb_image, '_wp_attachment_image_alt', true)); ?> <?php if ($image) { ?> <li class="has-image"> <a href="<?php echo esc_url($post_permalink); ?> " class="recent-post-image"> <img src="<?php echo esc_url($image[0]); ?> " width="<?php echo esc_attr($image[1]); ?> " height="<?php echo esc_attr($image[2]); ?> " alt="<?php echo esc_attr($image_alt); ?> "/> </a> <?php } else { ?> <li> <?php } ?> <div class="recent-post-details"> <a class="recent-post-title" href="<?php echo esc_url($post_permalink); ?> " title="<?php echo esc_attr($post_title); ?> "><?php echo esc_attr($post_title); ?> </a> <?php if (sf_theme_opts_name() == "sf_uplift_options") { echo '<div class="excerpt">' . sf_excerpt(20) . '</div>'; 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>'; } } else { ?> <span><?php printf(__('By %1$s on %2$s', 'swiftframework'), $post_author, $post_date); ?> </span> <div class="comments-likes"> <?php if (comments_open()) { ?> <div class="comments-wrapper"> <a href="<?php echo esc_url($post_permalink); ?> #comment-area"><?php echo apply_filters('sf_comments_icon', '<i class="ss-chat"></i>'); ?> <span><?php echo esc_attr($post_comments); ?> </span></a> </div> <?php } ?> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link(get_the_ID(), false); } ?> </div> <?php } ?> </div> </li> <?php } wp_reset_postdata(); ?> </ul> <?php } ?> <?php echo $after_widget; }
protected function content($atts, $content = null) { $title = $width = $el_class = $output = $filter = $social_icon_type = $items = $team_member_link_class = $el_position = ''; extract(shortcode_atts(array('title' => '', 'item_columns' => '3', 'display_type' => 'standard', 'carousel' => 'no', "item_count" => '12', "custom_image_height" => '', "category" => '', 'pagination' => '', 'post_ids' => '', 'profile_link' => 'yes', 'ajax_overlay' => 'no', 'fullwidth' => 'no', 'gutters' => 'yes', 'order' => 'desc', 'order_by' => 'date', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts)); // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); $contact_icon = apply_filters('sf_mail_icon', '<i class="ss-mail"></i>'); $phone_icon = apply_filters('sf_phone_icon', '<i class="ss-phone"></i>'); /* SIDEBAR CONFIG ================================================== */ global $sf_sidebar_config; $sidebars = ''; if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") { $sidebars = 'one-sidebar'; } else { if ($sf_sidebar_config == "both-sidebars") { $sidebars = 'both-sidebars'; } else { $sidebars = 'no-sidebars'; } } global $post, $wp_query; $paged = get_query_var('paged') ? get_query_var('paged') : 1; $team_args = array('post_type' => 'team', 'post_status' => 'publish', 'paged' => $paged, 'team-category' => $category_slug, 'posts_per_page' => $item_count, 'order' => $order, 'orderby' => $order_by, 'ignore_sticky_posts' => 1); if ($post_ids != "") { $team_args['post__in'] = array($post_ids); } $team_members = new WP_Query($team_args); $count = 0; $image_width = 270; $image_height = 270; if ($item_columns == "1") { $item_class = 'col-sm-12'; } else { if ($item_columns == "2") { $image_width = 540; $image_height = 540; $item_class = 'col-sm-6'; } else { if ($item_columns == "3") { $image_width = 360; $image_height = 360; $item_class = 'col-sm-4'; } else { if ($item_columns == "5") { $image_width = 360; $image_height = 360; $item_class = 'col-sm-sf-5'; } else { $item_class = 'col-sm-3'; } } } } if ($custom_image_height != "") { $image_height = $custom_image_height; } $list_class = 'display-type-' . $display_type; if ($ajax_overlay == "yes") { $team_member_link_class = 'team-member-ajax'; } if ($gutters == "no") { $list_class .= ' no-gutters'; } if ($carousel == "yes") { global $sf_carouselID; if ($sf_carouselID == "") { $sf_carouselID = 1; } else { $sf_carouselID++; } $item_class = 'carousel-item'; $items .= '<div class="team-carousel carousel-wrap"><div id="carousel-' . $sf_carouselID . '" class="team-members carousel-items ' . $list_class . ' clearfix" data-columns="' . $item_columns . '" data-auto="false">'; } else { $items .= '<div class="team-members ' . $list_class . ' row clearfix">'; } while ($team_members->have_posts()) { $team_members->the_post(); $postID = $post->ID; $member_name = get_the_title(); $member_position = sf_get_post_meta($postID, 'sf_team_member_position', true); $custom_excerpt = sf_get_post_meta($postID, 'sf_custom_excerpt', true); $pb_active = get_post_meta($postID, '_spb_js_status', true); $member_link = get_permalink($postID); $member_bio = ""; if ($pb_active == "true") { if ($custom_excerpt != "") { $member_bio = $custom_excerpt; } else { $member_bio = get_the_excerpt(); } } else { if ($custom_excerpt != "") { $member_bio = sf_custom_excerpt($custom_excerpt, 1000); } else { $member_bio = apply_filters('the_content', get_the_content('')); } } $member_email = sf_get_post_meta($postID, 'sf_team_member_email', true); $member_phone = sf_get_post_meta($postID, 'sf_team_member_phone_number', true); $member_twitter = sf_get_post_meta($postID, 'sf_team_member_twitter', true); $member_facebook = sf_get_post_meta($postID, 'sf_team_member_facebook', true); $member_linkedin = sf_get_post_meta($postID, 'sf_team_member_linkedin', true); $member_google_plus = sf_get_post_meta($postID, 'sf_team_member_google_plus', true); $member_skype = sf_get_post_meta($postID, 'sf_team_member_skype', true); $member_instagram = sf_get_post_meta($postID, 'sf_team_member_instagram', true); $member_dribbble = sf_get_post_meta($postID, 'sf_team_member_dribbble', true); $view_profile_text = __("View Profile", 'swift-framework-plugin'); $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full'); $item_icon = apply_filters('sf_team_hover_icon', "fa-pencil"); $item_svg_icon = apply_filters('sf_team_hover_svg_icon', ""); $thumb_img_url = ""; foreach ($thumb_image as $detail_image) { $thumb_image_id = $detail_image['ID']; $thumb_img_url = $detail_image['url']; break; } if (!$thumb_image) { $thumb_image = get_post_thumbnail_id(); $thumb_image_id = $thumb_image; $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); } $image = sf_aq_resize($thumb_img_url, $image_width, $image_height, true, false); // Output $items .= '<div itemscope data-id="id-' . $count . '" class="clearfix team-member ' . $item_class . '">'; if (sf_theme_supports('minimal-team-hover')) { $items .= '<div class="team-member-item-wrap">'; } $items .= '<figure class="animated-overlay">'; if (sf_theme_supports('minimal-team-hover') && $display_type != "gallery") { $items .= '<a class="team-member-link ' . $team_member_link_class . '" href="' . get_permalink() . '" data-id="' . $postID . '"></a>'; } if ($display_type == "gallery") { $items .= '<a class="team-gallery-mobile-link" href="' . get_permalink() . '" class="' . $team_member_link_class . '" data-id="' . $postID . '"></a>'; } if ($image) { $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $member_name . '" />'; } $items .= '<figcaption class="team-' . $display_type . '">'; if (sf_theme_supports('minimal-team-hover') && $display_type != "gallery") { $items .= '<div class="thumb-info thumb-info-alt">'; if ($item_svg_icon != "") { $items .= $item_svg_icon; } else { $items .= '<i class="' . $item_icon . '"></i>'; } $items .= '</div>'; } else { $items .= '<div class="thumb-info">'; if ($display_type == "gallery") { if ($profile_link == "yes") { $items .= '<h4 class="team-member-name"><a href="' . get_permalink() . '" class="' . $team_member_link_class . '" data-id="' . $postID . '">' . $member_name . '</a></h4>'; } else { $items .= '<h4 class="team-member-name">' . $member_name . '</h4>'; } $items .= '<h5 class="team-member-position">' . $member_position . '</h5>'; $items .= '<div class="name-divide"></div>'; } if ($member_twitter || $member_facebook || $member_linkedin || $member_google_plus || $member_skype || $member_instagram || $member_dribbble) { $items .= '<ul class="social-icons">'; if ($member_twitter) { $items .= '<li class="twitter"><a href="http://www.twitter.com/' . $member_twitter . '" target="_blank"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></li>'; } if ($member_facebook) { $items .= '<li class="facebook"><a href="' . $member_facebook . '" target="_blank"><i class="fa-facebook"></i><i class="fa-facebook"></i></a></li>'; } if ($member_linkedin) { $items .= '<li class="linkedin"><a href="' . $member_linkedin . '" target="_blank"><i class="fa-linkedin"></i><i class="fa-linkedin"></i></a></li>'; } if ($member_google_plus) { $items .= '<li class="googleplus"><a href="' . $member_google_plus . '" target="_blank"><i class="fa-google-plus"></i><i class="fa-google-plus"></i></a></li>'; } if ($member_skype) { $items .= '<li class="skype"><a href="skype:' . $member_skype . '" target="_blank"><i class="fa-skype"></i><i class="fa-skype"></i></a></li>'; } if ($member_instagram) { $items .= '<li class="instagram"><a href="' . $member_instagram . '" target="_blank"><i class="fa-instagram"></i><i class="fa-instagram"></i></a></li>'; } if ($member_dribbble) { $items .= '<li class="dribbble"><a href="http://www.dribbble.com/' . $member_dribbble . '" target="_blank"><i class="fa-dribbble"></i><i class="fa-dribbble"></i></a></li>'; } $items .= '</ul>'; } if ($display_type != "gallery" && $profile_link == "yes") { $items .= '<a class="view-profile ' . $team_member_link_class . '" href="' . $member_link . '" data-id="' . $postID . '">' . $view_profile_text . '</a>'; } $items .= '</div>'; } $items .= '</figcaption>'; $items .= '</figure>'; if (sf_theme_supports('minimal-team-hover')) { $items .= '<div class="team-member-details-wrap">'; } if ($display_type != "gallery") { if ($profile_link == "yes") { $items .= '<h4 class="team-member-name"><a href="' . get_permalink() . '" class="' . $team_member_link_class . '" data-id="' . $postID . '">' . $member_name . '</a></h4>'; } else { $items .= '<h4 class="team-member-name">' . $member_name . '</h4>'; } $items .= '<h5 class="team-member-position">' . $member_position . '</h5>'; } if ($display_type == "standard") { if (sf_theme_supports('minimal-team-hover')) { $items .= '<div class="team-member-divider"></div>'; } if ($profile_link == "yes") { $items .= '<div class="team-member-bio">' . $member_bio . '<a href="' . get_permalink() . '" class="read-more ' . $team_member_link_class . '" data-id="' . $postID . '">' . $view_profile_text . '</a></div>'; } else { $items .= '<div class="team-member-bio">' . $member_bio . '</div>'; $items .= '<ul class="member-contact">'; if ($member_email) { $items .= '<li>' . $contact_icon . '<span itemscope="email"><a href="mailto:' . $member_email . '">' . $member_email . '</a></span></li>'; } if ($member_phone) { $items .= '<li>' . $phone_icon . '<span itemscope="telephone">' . $member_phone . '</span></li>'; } $items .= '</ul>'; } } if (sf_theme_supports('minimal-team-hover')) { $items .= '</div>'; $items .= '</div>'; } $items .= '</div>'; $count++; } wp_reset_postdata(); if ($carousel == "yes") { $items .= '</div></div>'; } else { $items .= '</div>'; } // PAGINATION if ($pagination == "yes" && $carousel == "no") { $items .= '<div class="pagination-wrap">'; $items .= pagenavi($team_members); $items .= '</div>'; } $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="team_list carousel-asset spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb-asset-content">'; if ($fullwidth == "yes" && $sidebars == "no-sidebars") { $output .= "\n\t\t" . '<div class="title-wrap container">'; if ($title != '') { $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>'; } if ($carousel == "yes") { $output .= spb_carousel_arrows(); } $output .= '</div>'; } else { $output .= "\n\t\t" . '<div class="title-wrap clearfix">'; if ($title != '') { $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>'; } if ($carousel == "yes") { $output .= spb_carousel_arrows(); } $output .= '</div>'; } $output .= "\n\t\t" . $items; $output .= "\n\t\t" . '</div>'; $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); if ($fullwidth == "yes" && $sidebars == "no-sidebars") { $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true); } else { $output = $this->startRow($el_position) . $output . $this->endRow($el_position); } global $sf_include_isotope, $sf_has_team, $sf_include_carousel; $sf_include_isotope = true; $sf_has_team = true; if ($carousel == "yes") { $sf_include_carousel = true; } return $output; }
protected function content($atts, $content = null) { $title = $width = $el_class = $output = $wrap_span = $tax_terms = $filter = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', 'category' => '', 'alt_background' => 'none', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts)); // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); // CLIENTS QUERY SETUP global $post, $wp_query; $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true); $sidebars = ''; if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") { $wrap_span = "col-sm-6"; $sidebars = 'one-sidebar'; } else { if ($sidebar_config == "both-sidebars") { $wrap_span = "col-sm-4"; $sidebars = 'both-sidebars'; } else { $wrap_span = "col-sm-10"; $sidebars = 'no-sidebars'; } } $client_args = array('post_type' => 'clients', 'post_status' => 'publish', 'clients-category' => $category_slug, 'posts_per_page' => 5); $clients_items = new WP_Query($client_args); $items .= '<h4 class="span2">' . $title . '</h4>'; $items .= '<div class="featured-clients-items-wrap ' . $wrap_span . '">'; $items .= '<ul class="featured-clients-items row clearfix">'; $client_width = 300; $client_height = NULL; // CLIENTS LOOP while ($clients_items->have_posts()) { $clients_items->the_post(); $client_image = get_post_thumbnail_id(); $client_img_url = wp_get_attachment_url($client_image, 'full'); $client_link_url = sf_get_post_meta($post->ID, 'sf_client_link', true); $items .= '<li class="clearfix span2">'; $items .= '<figure>'; $image = sf_aq_resize($client_img_url, $client_width, $client_height, true, false); if ($image) { if ($client_link_url) { $items .= '<a href="' . $client_link_url . '" target="_blank"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" /></a>'; } else { $items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />'; } } $items .= '</figure>'; } wp_reset_postdata(); $items .= '</ul></div>'; // Full width setup $fullwidth = false; if ($alt_background != "none" && $sidebars == "no-sidebars") { $fullwidth = true; } // PAGE BUILDER OUPUT $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="spb_featured_clients_widget spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper clients-wrap row">'; $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, $width, $fullwidth, "", $alt_background) . $output . $this->endRow($el_position, $width, $fullwidth); return $output; }
public function content($atts, $content = null) { $title = $order = $items = $el_class = $width = $el_position = ''; extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'order' => '', 'category' => '', 'pagination' => 'no', 'el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts)); $output = ''; // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); // JOBS QUERY SETUP global $post, $wp_query; $paged = get_query_var('paged') ? get_query_var('paged') : 1; $jobs_args = array('orderby' => $order, 'post_type' => 'jobs', 'post_status' => 'publish', 'paged' => $paged, 'jobs-category' => $category_slug, 'posts_per_page' => $item_count); $jobs = new WP_Query($jobs_args); $items .= '<ul class="jobs clearfix">'; // JOBS LOOP while ($jobs->have_posts()) { $jobs->the_post(); $job_title = get_the_title(); $job_date = get_the_date(); $job_text = get_the_excerpt(); $job_image = get_post_thumbnail_id(); $job_image_url = wp_get_attachment_url($job_image, 'full'); $image = sf_aq_resize($job_image_url, 90, NULL, true, false); $items .= '<li class="job">'; if ($image) { $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />'; $items .= '<div class="job-details has-job-image">'; } else { $items .= '<div class="job-details">'; } $items .= '<span class="job-date">' . $job_date . '</span>'; $items .= '<h5>' . $job_title . '</h5>'; $items .= '<div class="job-text">' . do_shortcode($job_text) . '</div>'; $items .= '<a href="' . get_permalink() . '" class="read-more">' . __("Learn more", "swiftframework") . '</a>'; $items .= '</div>'; $items .= '</li>'; } wp_reset_postdata(); $items .= '</ul>'; // PAGINATION if ($pagination == "yes") { $items .= '<div class="pagination-wrap">'; $items .= pagenavi($jobs); $items .= '</div>'; } $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper jobs-wrap">'; $output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>' : ''; $output .= "\n\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; }
protected function content($atts, $content = null) { $title = $width = $el_class = $output = $filter = $social_icon_type = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', 'item_columns' => '3', "item_count" => '12', "category" => '', 'social_icon_type' => 'dark', 'pagination' => '', '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; $paged = get_query_var('paged') ? get_query_var('paged') : 1; $team_args = array('post_type' => 'team', 'post_status' => 'publish', 'paged' => $paged, 'team-category' => $category_slug, 'posts_per_page' => $item_count, 'ignore_sticky_posts' => 1); $team_members = new WP_Query($team_args); $count = 0; $image_width = 270; $image_height = 270; if ($item_columns == "1") { $item_class = 'col-sm-12'; } else { if ($item_columns == "2") { $image_width = 540; $image_height = 540; $item_class = 'col-sm-6'; } else { if ($item_columns == "3") { $image_width = 360; $image_height = 360; $item_class = 'col-sm-4'; } else { $item_class = 'col-sm-3'; } } } $items .= '<ul class="team-members row clearfix">'; while ($team_members->have_posts()) { $team_members->the_post(); $member_name = get_the_title(); $member_position = sf_get_post_meta($post->ID, 'sf_team_member_position', true); $member_bio = get_the_content(); $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true); if ($custom_excerpt != "") { $member_bio = sf_custom_excerpt($custom_excerpt, 1000); } $member_email = sf_get_post_meta($post->ID, 'sf_team_member_email', true); $member_phone = sf_get_post_meta($post->ID, 'sf_team_member_phone_number', true); $member_twitter = sf_get_post_meta($post->ID, 'sf_team_member_twitter', true); $member_facebook = sf_get_post_meta($post->ID, 'sf_team_member_facebook', true); $member_linkedin = sf_get_post_meta($post->ID, 'sf_team_member_linkedin', true); $member_google_plus = sf_get_post_meta($post->ID, 'sf_team_member_google_plus', true); $member_skype = sf_get_post_meta($post->ID, 'sf_team_member_skype', true); $member_instagram = sf_get_post_meta($post->ID, 'sf_team_member_instagram', true); $member_dribbble = sf_get_post_meta($post->ID, 'sf_team_member_dribbble', true); $member_xing = sf_get_post_meta($post->ID, 'sf_team_member_xing', true); $member_image = get_post_thumbnail_id(); $member_link = get_permalink(); $items .= '<li itemscope data-id="id-' . $count . '" class="clearfix team-member ' . $item_class . '">'; $img_url = wp_get_attachment_url($member_image, 'full'); $image = sf_aq_resize($img_url, $image_width, $image_height, true, false); $items .= '<figure class="gallery-style">'; if ($image) { $items .= '<a href="' . get_permalink() . '"><img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" /></a>'; } $items .= '<figcaption>'; $items .= '<h5 class="team-member-name">' . $member_name . '</h5>'; $items .= '<h5 class="team-member-position">' . $member_position . '</h5>'; if ($member_twitter || $member_facebook || $member_linkedin || $member_google_plus || $member_skype || $member_instagram || $member_dribbble || $member_xing != "") { $items .= '<ul class="social-icons">'; if ($member_twitter) { $items .= '<li class="twitter"><a href="http://www.twitter.com/' . $member_twitter . '" target="_blank"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></li>'; } if ($member_facebook) { $items .= '<li class="facebook"><a href="' . $member_facebook . '" target="_blank"><i class="fa-facebook"></i><i class="fa-facebook"></i></a></li>'; } if ($member_linkedin) { $items .= '<li class="linkedin"><a href="' . $member_linkedin . '" target="_blank"><i class="fa-linkedin"></i><i class="fa-linkedin"></i></a></li>'; } if ($member_google_plus) { $items .= '<li class="googleplus"><a href="' . $member_google_plus . '" target="_blank"><i class="fa-google-plus"></i><i class="fa-google-plus"></i></a></li>'; } if ($member_skype) { $items .= '<li class="skype"><a href="skype:' . $member_skype . '" target="_blank"><i class="fa-skype"></i><i class="fa-skype"></i></a></li>'; } if ($member_instagram) { $items .= '<li class="instagram"><a href="' . $member_instagram . '" target="_blank"><i class="fa-instagram"></i><i class="fa-instagram"></i></a></li>'; } if ($member_dribbble) { $items .= '<li class="dribbble"><a href="http://www.dribbble.com/' . $member_dribbble . '" target="_blank"><i class="fa-dribbble"></i><i class="fa-dribbble"></i></a></li>'; } if ($member_xing) { $items .= '<li class="xing"><a href="' . $member_xing . '" target="_blank"><i class="fa-xing"></i><i class="fa-xing"></i></a></li>'; } $items .= '</ul>'; } $items .= '</figcaption>'; $items .= '</figure>'; $items .= '</li>'; $count++; } wp_reset_postdata(); $items .= '</ul>'; // PAGINATION if ($pagination == "yes") { $items .= '<div class="pagination-wrap">'; $items .= pagenavi($team_members); $items .= '</div>'; } $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="team_list_widget spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper">'; $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); global $sf_include_isotope, $sf_has_team; $sf_include_isotope = true; $sf_has_team = true; return $output; }
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; }
function sf_swift_slider() { global $post, $wp_query; $output = ''; $options = get_option('sf_dante_options'); $posts_slider_type = sf_get_post_meta($post->ID, 'sf_posts_slider_type', true); $posts_category = sf_get_post_meta($post->ID, 'sf_posts_slider_category', true); $portfolio_category = sf_get_post_meta($post->ID, 'sf_posts_slider_portfolio_category', true); $count = sf_get_post_meta($post->ID, 'sf_posts_slider_count', true); $args = array(); if ($posts_slider_type == "post") { $slider_category = $posts_category; if ($slider_category == "All") { $slider_category = "all"; } if ($slider_category == "all") { $slider_category = ''; } $category_slug = str_replace('_', '-', $slider_category); $args = array('post_type' => 'post', 'post_status' => 'publish', 'category_name' => $category_slug, 'posts_per_page' => $count); } else { if ($posts_slider_type == "hybrid") { $args = array('post_type' => array('post', 'portfolio'), 'post_status' => 'publish', 'posts_per_page' => $count); } else { $slider_category = $portfolio_category; if ($slider_category == "All") { $slider_category = "all"; } if ($slider_category == "all") { $slider_category = ''; } $category_slug = str_replace('_', '-', $slider_category); $args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'portfolio-category' => $category_slug, 'posts_per_page' => $count, 'no_found_rows' => 1); } } $slider_items = new WP_Query($args); if ($slider_items->have_posts()) { $output .= '<!--// SWIFT SLIDER //-->' . "\n"; $output .= '<div id="swift-slider" class="flexslider">' . "\n"; $output .= '<div class="swift-slider-loading"></div>' . "\n"; $output .= '<ul class="slides">' . "\n"; while ($slider_items->have_posts()) { $slider_items->the_post(); $post_title = get_the_title(); $post_permalink = get_permalink(); $post_author = get_the_author_link(); $post_date = get_the_date(); $post_client = sf_get_post_meta($post->ID, 'sf_portfolio_client', true); $post_categories = get_the_category_list(', '); if ($posts_slider_type == "portfolio") { $post_categories = get_the_term_list($post->ID, 'portfolio-category', '', ', '); } $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, 20); } else { $post_excerpt = sf_excerpt(20); } $posts_slider_image = rwmb_meta('sf_posts_slider_image', 'type=image&size=full'); $caption_position = sf_get_post_meta($post->ID, 'sf_caption_position', true); $accent_color = get_option('accent_color', '#fb3c2d'); $secondary_accent_color = get_option('secondary_accent_color', '#2e2e36'); $secondary_accent_alt_color = get_option('secondary_accent_alt_color', '#ffffff'); $media_image_url = ""; foreach ($posts_slider_image as $detail_image) { $media_image_url = $detail_image['url']; break; } if (!$posts_slider_image) { $posts_slider_image = get_post_thumbnail_id(); $media_image_url = wp_get_attachment_url($posts_slider_image, 'full'); } if (!$caption_position) { $caption_position = "caption-right"; } $image = sf_aq_resize($media_image_url, 1920, NULL, true, false); $output .= '<li>' . "\n"; $output .= '<div class="slide-caption-container">' . "\n"; if ($image) { $output .= '<div class="flex-caption ' . $caption_position . '">' . "\n"; $output .= '<div class="flex-caption-details">' . "\n"; $output .= '<div class="caption-details-inner">' . "\n"; $output .= '<div class="details clearfix">' . "\n"; $output .= '<span class="date">' . $post_date . '</span>' . "\n"; if ($post_client != "") { $output .= '<span class="item-client">' . __("Client: ", "swiftframework") . $post_client . '</span>' . "\n"; $output .= '<span class="item-categories">' . $post_categories . '</span>' . "\n"; } else { $output .= '<span class="item-author">' . __("Posted by ", "swiftframework") . $post_author . '</span>' . "\n"; $output .= '<span class="item-categories">' . $post_categories . '</span>' . "\n"; } $output .= '</div>'; if (comments_open()) { $output .= '<div class="comment-chart chart" data-percent="1" data-count="' . $post_comments . '" data-barcolor="' . $secondary_accent_color . '"><span>0</span><i class="ss-chat"></i></div>' . "\n"; } if (function_exists('lip_get_love_count')) { $output .= '<div class="loveit-chart chart" data-percent="1" data-count="' . lip_get_love_count($post->ID) . '" data-barcolor="' . $accent_color . '"><span>0</span><i class="ss-heart"></i></div>' . "\n"; } $output .= '</div>' . "\n"; $output .= '</div>' . "\n"; $output .= '<div class="flex-caption-headline clearfix">' . "\n"; $output .= '<h4><a href="' . $post_permalink . '"><span>' . $post_title . '</span><i class="ss-navigateright"></i></a></h4>' . "\n"; $output .= '</div></div></div>' . "\n"; $output .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $post_title . '" />' . "\n"; } else { $output .= '<div class="flex-caption-large clearfix">' . "\n"; $output .= '<h1><a href="' . $post_permalink . '">' . $post_title . '</a></h1>' . "\n"; $output .= '<div class="excerpt">' . $post_excerpt . '</div>' . "\n"; $output .= '<div class="cl-charts">' . "\n"; if (comments_open()) { $output .= '<div class="comment-chart fw-chart chart" data-percent="1" data-count="' . $post_comments . '" data-barcolor="' . $secondary_accent_alt_color . '"><span>0</span><i class="ss-chat"></i></div>' . "\n"; } if (function_exists('lip_get_love_count')) { $output .= '<div class="loveit-chart fw-chart chart" data-percent="1" data-count="' . lip_get_love_count($post->ID) . '" data-barcolor="' . $accent_color . '"><span>0</span><i class="ss-heart"></i></div>' . "\n"; } $output .= '</div>' . "\n"; $output .= '<div class="details clearfix">' . "\n"; $output .= '<span class="date">' . $post_date . '</span>' . "\n"; if ($post_client != "") { $output .= '<span class="item-client">' . __("Client: ", "swiftframework") . $post_client . '</span>' . "\n"; $output .= '<span class="item-categories">' . $post_categories . '</span>' . "\n"; } else { $output .= '<span class="item-author">' . __("Posted by ", "swiftframework") . $post_author . '</span>' . "\n"; $output .= '<span class="item-categories">' . $post_categories . '</span>' . "\n"; } $output .= '</div></div></div>' . "\n"; } $output .= '</li>' . "\n"; } wp_reset_postdata(); $output .= '</ul></div>' . "\n"; } echo $output; }
?> "> <?php sf_woo_product_badge(); ?> <?php if ($sf_product_multimasonry) { $thumb_image = get_post_thumbnail_id(); $thumb_image_id = $thumb_image; $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); if ($thumb_img_url == "") { $thumb_img_url = "default"; } $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false); $image_alt = esc_attr(sf_get_post_meta($thumb_image_id, '_wp_attachment_image_alt', true)); if ($image_alt == "") { $image_alt = get_the_title(); } if ($image) { echo '<div class="multi-masonry-img-wrap"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" /></div>' . "\n"; } } else { if ($product_display_type == "preview-slider") { if ($product->is_type('variable')) { echo '<div class="variable-image-wrapper is-variable">'; $img_count = 0; $available_variations = $product->get_available_variations(); if ($available_variations) { foreach ($available_variations as $variation) {
function widget($args, $instance) { global $post; extract($args); // Widget Options $title = apply_filters('widget_title', $instance['title']); // Title $number = $instance['number']; // Number of posts to show $category = $instance['category']; // Category to show if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); $count = 0; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $recent_posts = new WP_Query(array('post_type' => 'post', 'posts_per_page' => $number, 'category_name' => $category_slug)); $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; } if ($recent_posts->have_posts()) { ?> <ul class="recent-posts-list"> <?php while ($recent_posts->have_posts()) { $recent_posts->the_post(); if ($count == $number) { break; } $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(); $thumb_image = get_post_thumbnail_id(); $thumb_img_url = wp_get_attachment_url($thumb_image, 'widget-image'); $image = sf_aq_resize($thumb_img_url, 94, 75, true, false); ?> <li> <a href="<?php echo $post_permalink; ?> " class="recent-post-image"> <?php if ($image) { ?> <img src="<?php echo $image[0]; ?> " width="<?php echo $image[1]; ?> " height="<?php echo $image[2]; ?> " /> <?php } ?> </a> <div class="recent-post-details"> <a class="recent-post-title" href="<?php echo $post_permalink; ?> " title="<?php echo $post_title; ?> "><?php echo $post_title; ?> </a> <?php if ($single_author && !$remove_dates) { ?> <span><?php printf(__('%1$s', 'swiftframework'), $post_date); ?> </span> <?php } else { if (!$remove_dates) { ?> <span><?php printf(__('By %1$s on %2$s', 'swiftframework'), $post_author, $post_date); ?> </span> <?php } else { if (!$single_author) { ?> <span><?php printf(__('By %1$s', 'swiftframework'), $post_author); ?> </span> <?php } } } ?> <div class="comments-likes"> <?php if (comments_open()) { ?> <a href="<?php echo $post_permalink; ?> #comment-area"><i class="ss-chat"></i><span><?php echo $post_comments; ?> </span></a> <?php } ?> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>'); } ?> </div> </div> </li> <?php $count++; } ?> </ul> <?php wp_reset_query(); } ?> <?php echo $after_widget; }
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; }
public function content($atts, $content = null) { $title = $order = $page_link = $text_size = $items = $el_class = $width = $el_position = ''; extract(shortcode_atts(array('title' => '', 'text_size' => '', 'item_count' => '-1', 'order' => '', 'category' => '', 'pagination' => 'no', 'page_link' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts)); $output = ''; $next_icon = apply_filters('sf_next_icon', '<i class="ss-navigateright"></i>'); // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); // TESTIMONIAL QUERY SETUP global $post, $wp_query; $paged = get_query_var('paged') ? get_query_var('paged') : 1; if ($pagination == "yes") { $order = "date"; } $testimonials_args = array('orderby' => $order, 'post_type' => 'testimonials', 'post_status' => 'publish', 'paged' => $paged, 'testimonials-category' => $category_slug, 'posts_per_page' => $item_count); $testimonials = new WP_Query($testimonials_args); $items .= '<ul class="testimonials clearfix">'; // TESTIMONIAL LOOP while ($testimonials->have_posts()) { $testimonials->the_post(); $testimonial_text = get_the_content(); $testimonial_cite = sf_get_post_meta($post->ID, 'sf_testimonial_cite', true); $testimonial_cite_subtext = sf_get_post_meta($post->ID, 'sf_testimonial_cite_subtext', true); $testimonial_image = rwmb_meta('sf_testimonial_cite_image', 'type=image', $post->ID); foreach ($testimonial_image as $detail_image) { $testimonial_image_url = $detail_image['url']; break; } if (!$testimonial_image) { $testimonial_image = get_post_thumbnail_id(); $testimonial_image_url = wp_get_attachment_url($testimonial_image, 'full'); } $testimonial_image = sf_aq_resize($testimonial_image_url, 70, 70, true, false); $items .= '<li class="testimonial">'; $items .= '<div class="testimonial-text">' . do_shortcode($testimonial_text) . '</div>'; $items .= '<div class="testimonial-cite">'; if ($testimonial_image) { $items .= '<img src="' . $testimonial_image[0] . '" width="' . $testimonial_image[1] . '" height="' . $testimonial_image[2] . '" alt="' . $testimonial_cite . '" />'; $items .= '<div class="cite-text has-cite-image"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>'; } else { $items .= '<div class="cite-text"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>'; } $items .= '</div>'; $items .= '</li>'; } wp_reset_query(); wp_reset_postdata(); $items .= '</ul>'; if ($page_link == "yes") { global $sf_options; $testimonials_page = __($sf_options['testimonial_page'], 'swift-framework-plugin'); if ($testimonials_page) { $items .= '<a href="' . get_permalink($testimonials_page) . '" class="read-more">' . __("More", 'swift-framework-plugin') . $next_icon . '</a>'; } } // PAGINATION if ($pagination == "yes") { $items .= '<div class="pagination-wrap">'; $items .= pagenavi($testimonials); $items .= '</div>'; } $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $el_class .= ' testimonial'; $output .= "\n\t" . '<div class="spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb-asset-content testimonial-wrap ' . $text_size . '">'; $output .= $title != '' ? "\n\t\t\t" . $this->spb_title($title, '') : ''; $output .= "\n\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; }
public function content($atts, $content = null) { $title = $order = $page_link = $items = $item_class = $el_class = $width = $el_position = ''; extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'order' => '', 'category' => 'all', 'pagination' => 'no', 'page_link' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts)); $output = ''; // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); // TESTIMONIAL QUERY SETUP global $post, $wp_query, $sf_carouselID; if ($sf_carouselID == "") { $sf_carouselID = 1; } else { $sf_carouselID++; } $paged = get_query_var('paged') ? get_query_var('paged') : 1; $testimonials_args = array('orderby' => $order, 'post_type' => 'testimonials', 'post_status' => 'publish', 'paged' => $paged, 'testimonials-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1); $testimonials = new WP_Query($testimonials_args); $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true); $sidebars = ''; if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") { $sidebars = 'one-sidebar'; } else { if ($sidebar_config == "both-sidebars") { $sidebars = 'both-sidebars'; } else { $sidebars = 'no-sidebars'; } } global $column_width; if ($column_width != "") { if ($column_width == "1/1") { if ($sidebars == "both-sidebars") { $item_class = "span6"; } else { if ($sidebars == "one-sidebar") { $item_class = "span8"; } else { $item_class = "span12"; } } } else { if ($column_width == "1/2") { if ($sidebars == "both-sidebars") { $item_class = "span3"; } else { if ($sidebars == "one-sidebar") { $item_class = "span4"; } else { $item_class = "span6"; } } } else { if ($column_width == "3/4") { if ($sidebars == "both-sidebars") { $item_class = "span-bs-threequarter"; } else { if ($sidebars == "one-sidebar") { $item_class = "span6"; } else { $item_class = "span9"; } } } else { if ($column_width == "1/4") { if ($sidebars == "both-sidebars") { $item_class = "span-bs-quarter"; } else { if ($sidebars == "one-sidebar") { $item_class = "span2"; } else { $item_class = "span3"; } } } } } } } else { if ($width == "1/1") { if ($sidebars == "both-sidebars") { $item_class = "span6"; } else { if ($sidebars == "one-sidebar") { $item_class = "span8"; } else { $item_class = "span12"; } } } else { if ($width == "1/2") { if ($sidebars == "both-sidebars") { $item_class = "span3"; } else { if ($sidebars == "one-sidebar") { $item_class = "span4"; } else { $item_class = "span6"; } } } else { if ($width == "3/4") { if ($sidebars == "both-sidebars") { $item_class = "span-bs-threequarter"; } else { if ($sidebars == "one-sidebar") { $item_class = "span6"; } else { $item_class = "span9"; } } } else { if ($width == "1/4") { if ($sidebars == "both-sidebars") { $item_class = "span-bs-quarter"; } else { if ($sidebars == "one-sidebar") { $item_class = "span2"; } else { $item_class = "span3"; } } } } } } } $items .= '<div class="carousel-overflow"><ul id="carousel-' . $sf_carouselID . '" class="testimonials carousel-items clearfix" data-columns="1" data-auto="false">'; // TESTIMONIAL LOOP while ($testimonials->have_posts()) { $testimonials->the_post(); $testimonial_text = get_the_content(); $testimonial_cite = sf_get_post_meta($post->ID, 'sf_testimonial_cite', true); $testimonial_cite_subtext = sf_get_post_meta($post->ID, 'sf_testimonial_cite_subtext', true); $testimonial_image = rwmb_meta('sf_testimonial_cite_image', 'type=image', $post->ID); foreach ($testimonial_image as $detail_image) { $testimonial_image_url = $detail_image['url']; break; } if (!$testimonial_image) { $testimonial_image = get_post_thumbnail_id(); $testimonial_image_url = wp_get_attachment_url($testimonial_image, 'full'); } $testimonial_image = sf_aq_resize($testimonial_image_url, 70, 70, true, false); $items .= '<li class="testimonial carousel-item ' . $item_class . ' clearfix">'; $items .= '<div class="testimonial-text">' . do_shortcode($testimonial_text) . '</div>'; $items .= '<div class="testimonial-cite">'; if ($testimonial_image) { $items .= '<img src="' . $testimonial_image[0] . '" width="' . $testimonial_image[1] . '" height="' . $testimonial_image[2] . '" alt="' . $testimonial_cite . '" />'; $items .= '<div class="cite-text has-cite-image"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>'; } else { $items .= '<div class="cite-text"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>'; } $items .= '</div>'; $items .= '</li>'; } wp_reset_postdata(); $items .= '</ul>'; $items .= '<a href="#" class="prev"><i class="ss-navigateleft"></i></a><a href="#" class="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>'; if ($page_link == "yes") { $options = get_option('sf_dante_options'); $testimonials_page = __($options['testimonial_page'], 'swiftframework'); if ($testimonials_page) { $items .= '<a href="' . get_permalink($testimonials_page) . '" class="read-more">' . __("More", "swiftframework") . '<i class="ssnavigate-right"></i></a>'; } } $width = spb_translateColumnWidthToSpan($width); $el_class = $this->getExtraClass($el_class); $el_class .= ' testimonial'; $output .= "\n\t" . '<div class="spb_testimonial_carousel_widget spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper carousel-wrap">'; if ($title != '') { $output .= "\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); global $sf_include_carousel, $sf_include_isotope; $sf_include_carousel = true; $sf_include_isotope = true; return $output; }
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; }
function widget($args, $instance) { global $post; extract($args); // Widget Options $title = apply_filters('widget_title', $instance['title']); // Title $number = $instance['number']; // Number of posts to show $category = $instance['category']; // Category to show if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $recent_portfolio = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => $number, 'portfolio-category' => $category_slug)); if ($recent_portfolio->have_posts()) { ?> <ul class="recent-posts-list"> <?php while ($recent_portfolio->have_posts()) { $recent_portfolio->the_post(); $post_title = get_the_title(); $post_permalink = get_permalink(); $thumb_image = get_post_thumbnail_id(); $thumb_img_url = wp_get_attachment_url($thumb_image, 'widget-image'); $image = sf_aq_resize($thumb_img_url, 94, 75, true, false); ?> <li> <a href="<?php echo $post_permalink; ?> " class="recent-post-image"> <?php if ($image) { ?> <img src="<?php echo $image[0]; ?> " width="<?php echo $image[1]; ?> " height="<?php echo $image[2]; ?> " /> <?php } ?> </a> <div class="recent-post-details"> <a class="recent-post-title" href="<?php echo $post_permalink; ?> " title="<?php echo $post_title; ?> "><?php echo $post_title; ?> </a> </div> </li> <?php wp_reset_query(); } ?> </ul> <?php } ?> <?php echo $after_widget; }
function sf_gallery_thumbnail($display_type = "gallery", $link_type = "lightbox", $columns = "2", $gutters = "yes", $count = 0, $gallery_id = 0) { global $post, $sf_options; $gallery_thumb = $item_class = $link_config = ''; $thumb_width = 600; $thumb_height = 450; $video_height = 450; 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") { $thumb_width = 600; $thumb_height = 450; $video_height = 450; } } } if ($display_type == "masonry" || $display_type == "masonry-gallery") { $thumb_height = null; } $thumb_image = get_post_thumbnail_id(); $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); $item_title = get_the_title(); $item_subtitle = sf_get_post_meta($post->ID, 'sf_gallery_subtitle', true); $permalink = get_permalink(); $item_link = sf_gallery_item_link($link_type, $gallery_id); if ($display_type == "gallery" || $display_type == "masonry-gallery") { $gallery_thumb .= '<figure class="animated-overlay overlay-style">' . "\n"; } else { $gallery_thumb .= '<figure class="animated-overlay overlay-alt">' . "\n"; } $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false); if ($image) { $gallery_thumb .= '<a ' . $item_link['config'] . '></a>'; $gallery_thumb .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />' . "\n"; $gallery_thumb .= '<div class="figcaption-wrap"></div>'; if ($item_subtitle != "" && ($display_type == "gallery" || $display_type == "masonry-gallery")) { $gallery_thumb .= '<figcaption><div class="thumb-info">'; } else { if ($display_type == "standard" || $display_type == "masonry") { $gallery_thumb .= '<figcaption><div class="thumb-info thumb-info-alt">'; } else { $gallery_thumb .= '<figcaption><div class="thumb-info">'; } } if ($display_type == "gallery" || $display_type == "masonry-gallery") { $gallery_thumb .= '<h4 itemprop="name headline">' . $item_title . '</h4>'; if ($item_subtitle != "") { $gallery_thumb .= '<div class="name-divide"></div>'; } $gallery_thumb .= '<h5 itemprop="name alternativeHeadline">' . $item_subtitle . '</h5>'; } else { $gallery_thumb .= '<i class="' . $item_link['icon'] . '"></i>'; } $gallery_thumb .= '</div></figcaption>'; } $gallery_thumb .= '</figure>' . "\n"; return $gallery_thumb; }