protected function content($atts, $content = null) { $title = $width = $el_class = $filter_output = $exclude_categories = $output = $tax_terms = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', 'display_type' => 'standard', 'columns' => '4', 'show_title' => 'yes', 'show_subtitle' => 'yes', 'show_excerpt' => 'no', 'hover_show_excerpt' => 'no', "excerpt_length" => '20', 'item_count' => '-1', 'category' => '', 'portfolio_filter' => 'yes', 'pagination' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts)); /* for PRO users! - SIDEBAR CONFIG ================================================== */ $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'; } } /* for PRO users! - PORTFOLIO FILTER ================================================== */ if ($portfolio_filter == "yes" && $sidebars == "no-sidebars") { if ($display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") { $filter_output = sf_portfolio_filter('full-width', $category); } else { $filter_output = sf_portfolio_filter('', $category); } } /* for PRO users! - PORTFOLIO ITEMS ================================================== */ $items = sf_portfolio_items($display_type, $columns, $show_title, $show_subtitle, $show_excerpt, $hover_show_excerpt, $excerpt_length, $item_count, $category, $exclude_categories, $pagination, $sidebars); /* for PRO users! - PAGE BUILDER OUTPUT ================================================== */ $width = spb_translateColumnWidthToSpan($width); $el_class = $this->getExtraClass($el_class); $output .= "\n\t" . '<div class="spb_portfolio_widget spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper portfolio-wrap">'; $output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>' : ''; if ($filter_output != "") { $output .= "\n\t\t\t" . $filter_output; } $output .= "\n\t\t\t" . $items; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); if ($display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") { $output = $this->startRow($el_position, '', true, "full-width") . $output . $this->endRow($el_position, '', true); } else { $output = $this->startRow($el_position) . $output . $this->endRow($el_position); } global $sf_include_isotope; $sf_include_isotope = true; global $sf_has_portfolio; $sf_has_portfolio = true; return $output; }
protected function content($atts, $content = null) { $title = $width = $el_class = $exclude_categories = $multi_size_ratio = $hover_style = $output = $tax_terms = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', 'display_type' => 'standard', 'multi_size_ratio' => '1/1', 'fullwidth' => 'no', 'gutters' => 'yes', 'columns' => '4', 'show_title' => 'yes', 'show_subtitle' => 'yes', 'show_excerpt' => 'no', 'hover_show_excerpt' => 'no', 'excerpt_length' => '20', 'item_count' => '-1', 'category' => '', 'order' => 'desc', 'order_by' => 'none', 'portfolio_filter' => 'yes', 'pagination' => 'no', 'button_enabled' => 'no', 'hover_style' => 'default', 'post_type' => 'portfolio', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts)); $view_all_icon = apply_filters('sf_view_all_icon', '<i class="ss-layergroup"></i>'); /* SIDEBAR CONFIG ================================================== */ global $sf_sidebar_config, $sf_options; $sidebars = ''; if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") { $sidebars = 'one-sidebar'; } else { if ($sf_sidebar_config == "both-sidebars") { $sidebars = 'both-sidebars'; } else { $sidebars = 'no-sidebars'; } } /* PORTFOLIO ITEMS ================================================== */ $items = sf_portfolio_items($atts); /* PAGE BUILDER OUTPUT ================================================== */ $width = spb_translateColumnWidthToSpan($width); $el_class = $this->getExtraClass($el_class); $has_button = false; $page_button = $title_wrap_class = ""; $portfolio_page = __($sf_options['portfolio_page'], 'swift-framework-plugin'); if ($portfolio_page != "") { $has_button = true; $page_button = '<a class="sf-button medium white sf-icon-stroke " href="' . get_permalink($portfolio_page) . '">' . $view_all_icon . '<span class="text">' . __("VIEW ALL PROJECTS", 'swift-framework-plugin') . '</span></a>'; } if ($portfolio_filter == "yes") { $title_wrap_class .= 'has-filter '; } else { if ($has_button && $button_enabled == "yes") { $title_wrap_class .= 'has-button '; } } if ($fullwidth == "yes" && $sidebars == "no-sidebars") { $title_wrap_class .= 'container '; } $output .= "\n\t" . '<div class="spb_portfolio_widget portfolio-wrap spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb-asset-content">'; if ($title != '' || $portfolio_filter == "yes") { $output .= "\n\t\t" . '<div class="title-wrap clearfix ' . $title_wrap_class . '">'; if ($title != '') { $output .= '<h2 class="spb-heading"><span>' . $title . '</span></h2>'; } if ($portfolio_filter == "yes") { $output .= sf_portfolio_filter('', $post_type); } else { if ($has_button && $button_enabled == "yes") { $output .= $page_button; } } $output .= '</div>'; } $output .= "\n\t\t" . $items; $output .= "\n\t\t" . '</div>'; $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); if ($fullwidth == "yes" && $sidebars == "no-sidebars") { $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_portfolio; $sf_include_isotope = true; $sf_has_portfolio = true; return $output; }