示例#1
0
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $output = $show_blog_aux = $exclude_categories = $blog_aux = $show_read_more = $offset = $posts_order = $content_output = $items = $item_figure = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'show_blog_aux' => 'yes', "blog_type" => "standard", "masonry_effect_type" => "effect-1", 'show_title' => 'yes', 'show_excerpt' => 'yes', "show_details" => 'yes', "offset" => '0', "posts_order" => 'DESC', "excerpt_length" => '20', 'show_read_more' => 'yes', "item_count" => '5', "category" => '', "exclude_categories" => '', "pagination" => "no", "content_output" => 'excerpt', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $width = spb_translateColumnWidthToSpan($width);
     /* SIDEBAR CONFIG
        ================================================== */
     $sidebar_config = 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';
         }
     }
     /* BLOG AUX
        ================================================== */
     if ($show_blog_aux == "yes" && $sidebars == "no-sidebars") {
         $blog_aux = sf_blog_aux($width);
     }
     /* BLOG ITEMS
        ================================================== */
     $items = sf_blog_items($blog_type, $masonry_effect_type, $show_title, $show_excerpt, $show_details, $excerpt_length, $content_output, $show_read_more, $item_count, $category, $exclude_categories, $pagination, $sidebars, $width, $offset, $posts_order);
     /* FINAL OUTPUT
     			================================================== */
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_blog_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper blog-wrap">';
     $output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>' : '';
     if ($blog_aux != "") {
         $output .= "\n\t\t\t" . $blog_aux;
     }
     $output .= "\n\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($blog_type == "masonry-fw") {
         $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_has_blog, $sf_include_imagesLoaded;
     $sf_include_imagesLoaded = true;
     $sf_has_blog = true;
     return $output;
 }
示例#2
0
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $output = $gutters = $fullwidth = $columns = $hover_style = $show_read_more = $offset = $order = $content_output = $items = $item_figure = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'blog_type' => 'standard', 'gutters' => 'yes', 'columns' => '4', 'fullwidth' => 'no', 'include_sticky' => 'no', 'show_title' => 'yes', 'show_excerpt' => 'yes', 'show_details' => 'yes', 'offset' => '0', 'order_by' => 'date', 'order' => 'DESC', 'excerpt_length' => '20', 'show_read_more' => 'yes', 'item_count' => '5', 'category' => '', 'exclude_categories' => '', 'pagination' => 'no', 'social_integration' => 'no', 'twitter_username' => '', 'instagram_id' => '', 'instagram_token' => '', 'blog_filter' => '', 'basic_blog_filter' => '', 'alt_styling' => 'no', 'hover_style' => 'default', 'content_output' => 'excerpt', 'post_type' => 'post', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $width = spb_translateColumnWidthToSpan($width);
     /* 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';
         }
     }
     /* BLOG AUX
        ================================================== */
     //          if ($show_blog_aux == "yes" && $sidebars == "no-sidebars") {
     //              $blog_aux = sf_blog_aux($width);
     //          }
     /* BLOG ITEMS
        ================================================== */
     $items = sf_blog_items($atts);
     /* FINAL OUTPUT
        ================================================== */
     $title_wrap_class = "";
     if ($blog_filter == "yes") {
         $title_wrap_class .= 'has-filter ';
     }
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $title_wrap_class .= 'container ';
     }
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_blog_widget blog-wrap spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     if ($title != '' || $blog_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 ($blog_filter == "yes") {
             $filter_style = "";
             if ($basic_blog_filter == "yes") {
                 $filter_style = "basic";
             }
             $output .= sf_post_filter($filter_style, $post_type, $category);
         }
         $output .= '</div>';
     }
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth == "yes") {
         $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_has_blog, $sf_include_imagesLoaded;
     $sf_include_imagesLoaded = true;
     $sf_has_blog = true;
     return $output;
 }