?> clearfix" data-blog-type="<?php echo esc_attr($blog_type); ?> "> <?php while (have_posts()) { the_post(); ?> <?php if (class_exists('ATCF_Campaigns')) { ?> <?php echo sf_get_campaign_item($blog_classes['item']); ?> <?php } else { ?> <?php $post_format = get_post_format($post->ID); if ($post_format == "") { $post_format = 'standard'; } ?> <li <?php post_class('blog-item ' . $blog_classes['item'] . ' format-' . $post_format); ?> itemscope itemtype="http://schema.org/BlogPosting"> <?php
protected function content($atts, $content = null) { $title = $width = $el_class = $output = $gutters = $fullwidth = $exclude_categories = $show_read_more = $offset = $posts_order = $content_output = $items = $item_figure = $el_position = ''; extract(shortcode_atts(array('title' => '', "fullwidth" => "no", "columns" => '4', "item_count" => '5', "category" => '', "pagination" => "no", "social_integration" => 'no', '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'; } } /* CATEGORY SLUG MODIFICATION ================================================== */ if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); /* CAMPAIGN 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; } $campaign_args = array('post_type' => 'download', 'post_status' => 'publish', 'paged' => $paged, 'download_category' => $category_slug, 'posts_per_page' => $item_count); $campaign_items = new WP_Query($campaign_args); $item_class = ""; if ($columns == "1") { $item_class = "col-sm-12 "; } else { if ($columns == "2") { $item_class = "col-sm-6 "; } else { if ($columns == "3") { $item_class = "col-sm-4 "; } else { if ($columns == "4") { $item_class = "col-sm-3 "; } else { if ($columns == "5") { $item_class = "col-sm-sf-5 "; } } } } } /* CAMPAIGN ITEMS ================================================== */ $items .= '<ul class="campaign-items masonry-items clearfix">'; while ($campaign_items->have_posts()) { $campaign_items->the_post(); $items .= sf_get_campaign_item($item_class); } $items .= '</ul>'; /* FINAL OUTPUT ================================================== */ if ($fullwidth == "yes") { $fullwidth = true; } else { $fullwidth = false; } $el_class = $this->getExtraClass($el_class); $output .= "\n\t" . '<div class="spb_campaigns_widget campaigns-wrap spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb-asset-content">'; $output .= $title != '' ? "\n\t\t\t" . $this->spb_title($widget_title, '', $fullwidth) : ''; $output .= "\n\t\t" . $items; $output .= "\n\t\t" . '</div>'; $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); if ($fullwidth) { $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; }