/** * Front-end display of widget **/ public function widget($args, $instance) { global $before_widget, $after_widget, $before_title, $after_title; extract($args); $title = apply_filters('widget_title', $instance['title']); $items_num = $instance['items_num']; $category = $instance['category']; $first_big = $instance['first_post']; $post_meta = $instance['post_meta']; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <?php /** * Latest Posts **/ if (!empty($category)) { $qy_galleries = new WP_Query(array('post_type' => 'gallery', 'tax_query' => array(array('taxonomy' => 'gallery-categories', 'field' => 'term_id', 'terms' => $category)), 'posts_per_page' => $items_num)); } else { $qy_galleries = new WP_Query(array('post_type' => 'gallery', 'posts_per_page' => $items_num)); } ?> <div class="widget-body"> <?php $i = 0; ?> <?php if ($qy_galleries->have_posts()) { while ($qy_galleries->have_posts()) { $qy_galleries->the_post(); $i++; ?> <?php if ($i == 1 && $first_big == 'yes') { ?> <div class="latest-post"> <?php if (has_post_thumbnail()) { ?> <div class="featured-image-wrap"> <a href="<?php echo esc_url(get_permalink()); ?> "> <img alt="<?php the_title(); ?> " class="featured-image" width="370" height="277" src="<?php echo fave_featured_image(get_the_ID(), 370, 277, true, true, true); ?> "> </a> </div><!-- slide-image-wrap --> <?php } ?> <div class="post"> <h2 class="post-title module-big-title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($post_meta != 'no') { ?> <ul class="list-inline post-meta hidden-sm hidden-md"> <?php get_template_part('inc/widgets', 'meta'); ?> </ul><!-- .post-meta --> <?php } ?> </div> </div> <?php } else { ?> <div class="latest-galleries"> <div class="row"> <div class="col-lg-6 col-md-6 col-sm-12 col-xs-4"> <div class="thumb"> <?php if (has_post_thumbnail()) { ?> <div class="slide-image-wrap slider-with-animation"> <a href="<?php echo esc_url(get_permalink()); ?> "> <img alt="<?php the_title(); ?> " class="featured-image" width="220" height="172" src="<?php echo fave_featured_image(get_the_ID(), 220, 172, true, true, true); ?> "> </a> </div><!-- slide-image-wrap --> <?php } ?> </div> </div><!-- col-lg-4 col-md-4 col-sm-4 col-xs-4 col-lg-push-3 col-md-push-3 --> <div class="col-lg-6 col-md-6 col-sm-12 col-xs-8 no-padding-left"> <article class="post"> <h2 class="post-title module-small-title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($post_meta != 'no') { ?> <ul class="list-inline post-meta"> <?php get_template_part('inc/widgets', 'meta'); ?> </ul><!-- .post-meta --> <?php } ?> </article><!-- .module-3-post --> </div><!-- col-lg-5 col-md-5 col-sm-8 col-xs-8 col-lg-push-3 col-md-push-3 --> </div><!-- .row --> </div> <?php } ?> <?php } } ?> <?php wp_reset_postdata(); ?> </div> <?php echo $after_widget; }
function fav_module_7($atts, $content = null) { extract(shortcode_atts(array('module_7_type' => '', 'category_id' => '', 'category_ids' => '', 'tag_slug' => '', 'sort' => '', 'autors_id' => '', 'posts_limit' => '', 'offset' => '', 'header_color' => '', 'header_text_color' => '', 'header_border_color' => '', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'title_style' => '', 'show_child_cat' => '', 'image_size' => '', 'module_space' => '', 'module_meta' => '', 'author_name' => '', 'time_diff' => '', 'post_date' => '', 'post_time' => '', 'post_view_count' => '', 'post_comment_count' => '', 'text_align' => '', 'module_bg' => '', 'module_padding' => ''), $atts)); ob_start(); if ($module_7_type == "two_columns") { $css_classes = "col-lg-6 col-md-6 col-sm-6 col-xs-6"; $columns_class = "module-7-two-cols"; } elseif ($module_7_type == "one_columns") { $css_classes = "col-lg-12 col-md-12 col-sm-12 col-xs-12"; $columns_class = "module-7-one-cols"; } else { $css_classes = "col-lg-4 col-md-4 col-sm-6 col-xs-6"; $columns_class = "module-7-three-cols"; } if ($image_size == '570_427') { $img_width = '570'; $img_height = '427'; } else { $img_width = '370'; $img_height = '277'; } $style = $bg = $padding = ''; if (!empty($module_bg)) { $bg = "background-color:" . $module_bg . ";"; } if (!empty($module_padding)) { $padding = "padding:" . $module_padding . ";"; } if (!empty($bg) || !empty($padding)) { $style = 'style="' . $bg . ' ' . $padding . '"'; } //do the query $the_query = fave_data_source::get_wp_query($atts); //by ref do the query ?> <div class="module module-7 <?php echo esc_attr($columns_class . ' ' . $text_align); ?> gallery-4" <?php echo $style; ?> > <?php if ($hide_title != 'hide_title') { ?> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="module-top clearfix"> <?php //get the block title echo fave_get_block_title($atts); //get the sub category filter for this block echo fave_get_block_sub_cats($atts); ?> </div><!-- .module-top --> </div><!-- col-lg-12 col-md-12 col-sm-12 col-xs-12 --> </div><!-- .row --> <?php } ?> <div class="row <?php if (!empty($module_space)) { echo $module_space; } ?> "> <?php while ($the_query->have_posts()) { $the_query->the_post(); ?> <div <?php post_class($css_classes); ?> <?php echo fave_get_item_scope(); ?> > <div class="thumb big-thumb"> <a itemprop="url" href="<?php echo esc_url(get_permalink()); ?> "></a> <div class="thumb-content"> <h2 itemprop="headline" class="gallery-title-small"><a itemprop="url" href="<?php echo esc_url(get_permalink()); ?> "><?php the_title(); ?> </a></h2> <ul class="list-inline post-meta hidden-xs hidden-sm hidden-md"> <?php fave_vc_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> </div> <div class="slide-image-wrap slider-with-animation"> <?php get_template_part('inc/article', 'icon'); ?> <img itemprop="image" class="featured-image" width="<?php echo $img_width; ?> " height="<?php echo $img_height; ?> " src="<?php echo fave_featured_image(get_the_ID(), $img_width, $img_height, true, true, true); ?> " alt="<?php the_title(); ?> "> </div><!-- slide-image-wrap --> </div><!-- thumb --> </div><!-- col-lg-4 col-md-4 col-sm-6 col-xs-6 --> <?php } ?> </div><!-- row --> </div><!-- .module-7 --> <?php $result = ob_get_contents(); ob_end_clean(); return $result; }
if (has_post_thumbnail()) { ?> <div class="featured-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <div class="category-label"><?php get_template_part('inc/post', 'cats'); ?> </div> <a href="<?php echo esc_url(get_permalink()); ?> "> <img itemprop="image" class="featured-image" src="<?php echo fave_featured_image(get_the_ID(), $img_1_width, $img_1_height, true, true, true); ?> " width="<?php echo $img_1_width; ?> " height="<?php echo $img_1_height; ?> " alt="<?php the_title(); ?> "> </a> </div><!-- featured-image-wrap --> <?php }
function fav_post_slider($atts, $content = null) { extract(shortcode_atts(array('slider_type' => '', 'slider_text_align' => '', 'post_from' => '', 'category_id' => '', 'category_ids' => '', 'image_crop' => '', 'hide_cat' => '', 'sort' => '', 'posts_limit' => '', 'slider_auto' => '', 'stop_on_hover' => '', 'navigation' => '', 'bullets_pagination' => '', 'touch_drag' => 'true', 'slide_loop' => 'false', 'rewind_nav' => '', 'lazy_load' => '', 'module_meta' => '', 'author_name' => '', 'time_diff' => '', 'post_date' => '', 'post_time' => '', 'post_view_count' => '', 'post_comment_count' => '', 'module_bg' => '', 'module_padding' => ''), $atts)); ob_start(); $style = $bg = $padding = ''; if (!empty($module_bg)) { $bg = "background-color:" . $module_bg . ";"; } if (!empty($module_padding)) { $padding = "padding:" . $module_padding . ";"; } if (!empty($bg) || !empty($padding)) { $style = 'style="' . $bg . ' ' . $padding . '"'; } //do the query $wp_query_args = array('ignore_sticky_posts' => 1); if ($post_from == "category_posts") { if (!empty($category_id) and empty($category_ids)) { $category_ids = $category_id; } if (!empty($category_ids)) { $wp_query_args['cat'] = $category_ids; } } if ($post_from == "featured") { $wp_query_args['meta_key'] = 'fave_featured'; $wp_query_args['meta_value'] = '1'; } $current_day = date('j'); switch ($sort) { case 'popular': $wp_query_args['meta_key'] = 'fave-post_views'; $wp_query_args['orderby'] = 'meta_value_num'; $wp_query_args['order'] = 'DESC'; break; case 'review_high': $wp_query_args['meta_key'] = ''; //td_review::$td_review_key; $wp_query_args['orderby'] = 'meta_value_num'; $wp_query_args['order'] = 'DESC'; break; case 'random_posts': $wp_query_args['orderby'] = 'rand'; break; case 'alphabetical_order': $wp_query_args['orderby'] = 'title'; $wp_query_args['order'] = 'ASC'; break; case 'comment_count': $wp_query_args['orderby'] = 'comment_count'; $wp_query_args['order'] = 'DESC'; break; case 'random_today': $wp_query_args['orderby'] = 'rand'; $wp_query_args['year'] = date('Y'); $wp_query_args['monthnum'] = date('n'); $wp_query_args['day'] = date('j'); break; case 'random_7_day': $wp_query_args['orderby'] = 'rand'; $wp_query_args['date_query'] = array('column' => 'post_date_gmt', 'after' => '1 week ago'); break; } //custom pagination limit if (empty($posts_limit)) { $posts_limit = get_option('posts_per_page'); } $wp_query_args['posts_per_page'] = $posts_limit; $the_query = new WP_Query($wp_query_args); $unique_key = fave_unique_key(); if (is_rtl()) { $magzilla_rtl = 'true'; } else { $magzilla_rtl = 'false'; } ?> <script> jQuery(document).ready(function($) { var $elements = $( '[data-vc-stretch-content="true"]' ); $.each( $elements, function ( key, item ) { var $el = $( this ); $el.children().children().children().children().children().addClass( 'banner-stretch-content' ); } ); var banner_slider = function () { $('#owl-carousel-grid-banner-slide-<?php echo $unique_key; ?> ').owlCarousel({ rtl: <?php echo $magzilla_rtl; ?> , loop: <?php echo $slide_loop; ?> , touchDrag: <?php echo $touch_drag; ?> , items: 1, //Autoplay autoplay: <?php echo $slider_auto; ?> , autoplayHoverPause: <?php echo $stop_on_hover; ?> , // Navigation nav: <?php echo $navigation; ?> , navText: ["<i class='fa fa-chevron-left'></i>", "<i class='fa fa-chevron-right'></i>"], navRewind: <?php echo $rewind_nav; ?> , dots: <?php echo $bullets_pagination; ?> , // Responsive responsiveClass: true, responsiveRefreshRate: 200, responsiveBaseWidth: window, //Lazy load lazyLoad: <?php echo $lazy_load; ?> , lazyFollow: true, lazyEffect: "fade", }); } if( $('#owl-carousel-grid-banner-slide-<?php echo $unique_key; ?> ').hasClass('banner-stretch-content') ) { $(window).load(function() { banner_slider(); }); } else { banner_slider(); } }); </script> <?php if ($slider_type == "fullwidth_slider") { ?> <div class="grid-banner banner-slide" <?php echo $style; ?> > <!-- owl-carousel-grid-banner-slide --> <div id="owl-carousel-grid-banner-slide-<?php echo $unique_key; ?> " class="owl-carousel"> <?php while ($the_query->have_posts()) { $the_query->the_post(); ?> <?php if (has_post_thumbnail()) { if ($image_crop == "yes") { $featured_image = fave_featured_image(get_the_ID(), 1470, 650, true, true, true); } else { $featured_image = fave_featured_image(get_the_ID(), 1470, 650, false); } } else { $featured_image = 'http://placehold.it/1170x400'; } ?> <div <?php post_class('slide'); ?> <?php echo fave_get_item_scope(); ?> > <div class="row row-no-padding"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="left-side"> <!-- thumb --> <div class="thumb"> <a href="<?php the_permalink(); ?> "></a> <div class="thumb-content <?php echo esc_attr($slider_text_align); ?> "> <?php if ($hide_cat != 'no') { ?> <div class="category-label"> <?php get_template_part('inc/post', 'cats'); ?> </div> <?php } ?> <h2 itemprop="headline" class="gallery-title-big"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <ul class="list-inline post-meta"> <?php fave_vc_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> </div> <div class="slide-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <img itemprop="image" class="featured-image lazyOwl" width="1170" height="440" data-src="<?php echo $featured_image; ?> " src="<?php echo $featured_image; ?> " alt="<?php the_title(); ?> "> </div><!-- slide-image-wrap --> </div> </div> </div><!-- col-xs-12 col-sm-12 col-md-12 col-lg-12 --> </div><!-- row row-no-padding --> </div><!-- slide --> <?php } ?> <?php /* Restore original Post Data */ wp_reset_postdata(); ?> </div><!-- owl-carousel-grid-banner-slide --> </div> <?php } elseif ($slider_type == "grid_slider") { ?> <div class="grid-banner grid-banner-slide" <?php echo $style; ?> > <!-- owl-carousel-grid-banner-slide --> <div id="owl-carousel-grid-banner-slide-<?php echo $unique_key; ?> " class="owl-carousel"> <?php $i = 0; $post_counter = 0; ?> <?php while ($the_query->have_posts()) { $the_query->the_post(); $i++; $post_counter++; ?> <?php if ($i == 1) { ?> <div <?php post_class('slide'); ?> <?php echo fave_get_item_scope(); ?> > <div class="row row-no-padding"> <?php } ?> <?php if ($i == 1) { ?> <div class="col-xs-12 col-sm-8 col-md-8 col-lg-8"> <div class="left-side"> <!-- thumb --> <div class="thumb"> <a href="<?php the_permalink(); ?> "></a> <div class="thumb-content"> <?php if ($hide_cat != 'no') { ?> <div class="category-label"> <?php get_template_part('inc/post', 'cats'); ?> </div> <?php } ?> <h2 itemprop="headline" class="gallery-title-big"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <ul class="list-inline post-meta"> <?php fave_vc_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> </div> <?php if (has_post_thumbnail()) { ?> <div class="slide-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <?php if ($image_crop == "yes") { ?> <img class="featured-image lazyOwl" width="780" height="440" data-src="<?php echo fave_featured_image(get_the_ID(), 780, 440, true, true, true); ?> " src="<?php echo fave_featured_image(get_the_ID(), 780, 440, true, true, true); ?> " alt="<?php the_title(); ?> "> <?php } else { ?> <img class="featured-image lazyOwl" width="780" height="440" data-src="<?php echo fave_featured_image(get_the_ID(), 780, 440, false); ?> " src="<?php echo fave_featured_image(get_the_ID(), 780, 440, false); ?> " alt="<?php the_title(); ?> "> <?php } ?> </div><!-- slide-image-wrap --> <?php } ?> </div> </div> </div><!-- col-xs-8 col-sm-8 col-md-8 col-lg-8 --> <?php } ?> <?php if ($i == 2) { ?> <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4"> <div class="right-side"> <?php } ?> <!-- thumb --> <?php if ($i == 2 || $i == 3) { ?> <div class="col-xs-6 col-sm-12 col-md-12 col-lg-12"> <div <?php post_class('thumb'); ?> <?php echo fave_get_item_scope(); ?> > <a href="<?php the_permalink(); ?> "></a> <div class="thumb-content"> <?php if ($hide_cat != 'no') { ?> <div class="category-label"> <?php get_template_part('inc/post', 'cats'); ?> </div> <?php } ?> <h2 itemprop="headline" class="gallery-title-small"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <ul class="list-inline post-meta"> <?php fave_vc_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> </div> <?php if (has_post_thumbnail()) { ?> <div class="slide-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <?php if ($image_crop == "yes") { ?> <img itemprop="image" class="featured-image lazyOwl" width="390" height="220" data-src="<?php echo fave_featured_image(get_the_ID(), 390, 220, true, true, true); ?> " src="<?php echo fave_featured_image(get_the_ID(), 390, 220, true, true, true); ?> " alt="<?php the_title(); ?> "> <?php } else { ?> <img itemprop="image" class="featured-image lazyOwl" width="390" height="220" data-src="<?php echo fave_featured_image(get_the_ID(), 390, 220, false); ?> " src="<?php echo fave_featured_image(get_the_ID(), 390, 220, false); ?> " alt="<?php the_title(); ?> "> <?php } ?> </div><!-- slide-image-wrap --> <?php } ?> </div> </div> <?php } ?> <?php if ($i == 3 || $i == 2 && $post_counter == $the_query->post_count) { ?> </div><!-- right-side --> </div><!-- col-xs-4 col-sm-4 col-md-4 col-lg-4 --> <?php } ?> <?php if ($i == 3 || $post_counter == $the_query->post_count) { $i = 0; ?> </div><!-- row row-no-padding --> </div><!-- slide --> <?php } ?> <?php } ?> <?php /* Restore original Post Data */ wp_reset_postdata(); ?> </div><!-- owl-carousel-grid-banner-slide --> </div> <?php } ?> <?php $result = ob_get_contents(); ob_end_clean(); return $result; }
function fav_gallery_module_2($atts, $content = null) { extract(shortcode_atts(array('category_id' => '', 'sort' => '', 'autors_id' => '', 'posts_limit' => '', 'offset' => '', 'header_color' => '', 'header_text_color' => '', 'header_border_color' => '', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'hide_meta' => '', 'title_style' => '', 'slider_post_row' => '', 'slider_auto' => '', 'stop_on_hover' => '', 'navigation' => '', 'touch_drag' => 'true', 'slide_loop' => 'false', 'rewind_nav' => '', 'lazy_load' => '', 'module_meta' => '', 'author_name' => '', 'time_diff' => '', 'post_date' => '', 'post_time' => '', 'post_view_count' => '', 'post_comment_count' => '', 'text_align' => '', 'module_bg' => '', 'module_padding' => ''), $atts)); ob_start(); $rnr_id = fave_element_key(); if (is_rtl()) { $magzilla_rtl = 'true'; } else { $magzilla_rtl = 'false'; } ?> <script> jQuery(document).ready(function($) { // Gallery 1 with sidebar $("#favethemes-carousel-<?php echo $rnr_id; ?> ").owlCarousel({ rtl: <?php echo $magzilla_rtl; ?> , loop: <?php echo $slide_loop; ?> , touchDrag: <?php echo $touch_drag; ?> , responsive:{ 0:{ items:2 }, 479:{ items:2 }, 768:{ items:3 }, 980:{ items:3 }, 1199:{ items:<?php echo $slider_post_row; ?> } }, //Autoplay autoplay : <?php echo $slider_auto; ?> , autoplayHoverPause : <?php echo $stop_on_hover; ?> , // Navigation nav : <?php echo $navigation; ?> , navRewind : <?php echo $rewind_nav; ?> , navText : ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"], // Responsive responsiveClass:true, responsiveRefreshRate : 200, responsiveBaseWidth: window, //Lazy load lazyLoad : <?php echo $lazy_load; ?> , lazyFollow : true, lazyEffect : "fade", }); }); </script> <?php //do the query $the_query = fave_gallery_post_type_data_source::get_wp_query($atts); if ($slider_post_row == '1') { $img_width = '1170'; $img_height = '658'; $title_custom_class = "title-cols-1"; } elseif ($slider_post_row == '2') { $img_width = '570'; $img_height = '428'; $title_custom_class = "title-cols-2"; } elseif ($slider_post_row == '3') { $img_width = '570'; $img_height = '428'; $title_custom_class = "title-cols-3"; } else { $img_width = '370'; $img_height = '278'; $title_custom_class = "title-cols-4"; } $style = $bg = $padding = ''; if (!empty($module_bg)) { $bg = "background-color:" . $module_bg . ";"; } if (!empty($module_padding)) { $padding = "padding:" . $module_padding . ";"; } if (!empty($bg) || !empty($padding)) { $style = 'style="' . $bg . ' ' . $padding . '"'; } ?> <div class="module-8 <?php echo $text_align; ?> gallery" <?php echo $style; ?> > <?php if ($hide_title != 'hide_title') { ?> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="module-top clearfix"> <?php echo fave_get_gallery_block_title($atts); ?> </div><!-- .module-top --> </div><!-- col-lg-12 col-md-12 col-sm-12 col-xs-12 --> </div><!-- .row --> <?php } ?> <div class="row"> <div id="favethemes-carousel-<?php echo esc_attr($rnr_id); ?> " class="owl-carousel"> <?php while ($the_query->have_posts()) { $the_query->the_post(); ?> <div class="slide"> <div class="slide-image-wrap slider-with-animation"> <div class="post-type-icon"><i class="fa fa-video-camera"></i></div> <a href="<?php echo esc_url(get_permalink()); ?> "> <img class="featured-image lazyOwl" data-src="<?php echo fave_featured_image(get_the_ID(), $img_width, $img_height, true, true, true); ?> " alt="<?php the_title(); ?> " src="<?php echo fave_featured_image(get_the_ID(), $img_width, $img_height, true, true, true); ?> "> </a> </div><!-- slide-image-wrap --> <h2 class="gallery-title-small <?php echo esc_attr($title_custom_class); ?> "><a href="<?php echo esc_url(get_permalink()); ?> "><?php the_title(); ?> </a></h2> <?php if ($hide_meta != 'hide_meta') { ?> <ul class="list-inline post-meta"> <?php fave_vc_gallery_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> <?php } ?> </div><!-- slide --> <?php } wp_reset_postdata(); ?> </div><!-- owl-carousel --> </div><!-- row --> </div><!-- .module-8 --> <?php $result = ob_get_contents(); ob_end_clean(); return $result; }
<?php if (has_post_thumbnail()) { ?> <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4"> <div class="featured-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <a href="<?php echo esc_url(get_permalink()); ?> "> <img class="featured-image" src="<?php echo fave_featured_image(get_the_ID(), 720, 539, true, true, true); ?> " alt="<?php the_title(); ?> "> </a> </div><!-- featured-image-wrap --> </div><!-- col-lg-4 col-md-4 col-sm-4 col-xs-4 --> <?php } ?> <?php if (has_post_thumbnail()) {
/** * Front-end display of widget **/ public function widget($args, $instance) { global $before_widget, $after_widget, $before_title, $after_title, $ft_option; extract($args); $title = apply_filters('widget_title', $instance['title']); $items_num = $instance['items_num']; $category = $instance['category']; $first_big = $instance['first_post']; $post_meta = $instance['post_meta']; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <?php $qy_latest = new WP_Query(array('post_type' => 'post', 'cat' => $category, 'posts_per_page' => $items_num, 'ignore_sticky_posts' => 1)); ?> <div class="widget-body"> <?php $i = 0; ?> <?php if ($qy_latest->have_posts()) { while ($qy_latest->have_posts()) { $qy_latest->the_post(); $i++; ?> <?php if ($i == 1 && $first_big == 'yes') { ?> <div class="latest-post"> <?php if (has_post_thumbnail()) { ?> <div class="featured-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <?php if ($ft_option['widget_category'] != 0) { ?> <div class="category-label"><?php get_template_part('inc/post', 'cats'); ?> </div> <?php } ?> <a href="<?php echo esc_url(get_permalink()); ?> "> <img alt="<?php the_title(); ?> " width="370" height="277" class="featured-image" src="<?php echo fave_featured_image(get_the_ID(), 370, 277, true, true, true); ?> "> </a> </div><!-- featured-image-wrap --> <?php } ?> <article class="post"> <h2 class="post-title module-big-title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($post_meta != 'no') { ?> <ul class="list-inline post-meta"> <?php get_template_part('inc/widgets', 'meta'); ?> </ul><!-- .post-meta --> <?php } ?> <div class="post-content post-small-content"> <p><?php echo fave_clean_excerpt('130', true); ?> </p> </div><!-- post-content --> </article><!-- .post --> </div> <?php } else { ?> <div class="latest-post"> <div class="row"> <div class="col-xs-4 col-sm-12 col-md-4 col-lg-4"> <?php if (has_post_thumbnail()) { ?> <div class="featured-image-wrap"> <?php if ($ft_option['widget_category'] != 0) { ?> <div class="category-label"><?php get_template_part('inc/post', 'cats'); ?> </div> <?php } ?> <a href="<?php echo esc_url(get_permalink()); ?> "> <img alt="<?php the_title(); ?> " width="200" height="200" class="featured-image" src="<?php echo fave_featured_image(get_the_ID(), 200, 200, true, true, true); ?> "> </a> </div> <?php } ?> </div> <div class="col-xs-8 col-sm-12 col-md-8 col-lg-8 no-padding-left"> <h2 class="post-title module-small-title"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h2> <?php if ($post_meta != 'no') { ?> <ul class="list-inline post-meta"> <?php get_template_part('inc/widgets', 'meta'); ?> </ul><!-- .post-meta --> <?php } ?> </div> </div> </div> <?php } ?> <?php } } ?> <?php wp_reset_postdata(); ?> </div> <?php echo $after_widget; }
<div class="featured-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <div class="category-label"><?php echo $cats_html; ?> </div> <a href="<?php echo esc_url(get_permalink()); ?> "> <img class="featured-image" src="<?php echo fave_featured_image(get_the_ID(), 770, 400, true, true, true); ?> " alt="<?php the_title(); ?> "> </a> </div><!-- featured-image-wrap --> <?php } ?> <article class="post"> <h2 class="post-title module-big-title"><a href="<?php echo esc_url(get_permalink()); ?>
/** * Front-end display of widget **/ public function widget($args, $instance) { global $before_widget, $after_widget, $before_title, $after_title; extract($args); $title = apply_filters('widget_title', $instance['title']); $items_num = $instance['items_num']; $category = $instance['category']; $post_meta = $instance['post_meta']; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <?php /** * Latest Posts **/ global $post; //init the array $wp_query_args = array('ignore_sticky_posts' => 1); if (!empty($category)) { $wp_query_args['cat'] = $category; } $wp_query_args['meta_key'] = 'fave_final_score'; $wp_query_args['orderby'] = 'meta_value_num'; $wp_query_args['order'] = 'DESC'; $wp_query_args['posts_per_page'] = $items_num; $qy_latest = new WP_Query($wp_query_args); ?> <div class="widget-body"> <?php $i = 0; ?> <?php if ($qy_latest->have_posts()) { while ($qy_latest->have_posts()) { $qy_latest->the_post(); $fave_score_display_type = get_post_meta(get_the_ID(), 'fave_score_display_type', true); $fave_final_score = get_post_meta(get_the_ID(), 'fave_final_score', true); $fave_final_score_override = get_post_meta(get_the_ID(), 'fave_final_score_override', true); /*if( !empty( $fave_final_score_override ) ) { $fave_final_score = $fave_final_score_override; }*/ $fave_review_final_score = intval($fave_final_score); if ($fave_score_display_type == 'percentage') { $fave_score_output = $fave_review_final_score . '%'; } if ($fave_score_display_type == 'points') { $fave_score_output = $fave_review_final_score / 10; } ?> <div class="latest-review"> <div class="row"> <div class="col-xs-4 col-sm-12 col-md-4 col-lg-4"> <?php if (has_post_thumbnail()) { ?> <div class="featured-image-wrap"> <a href="<?php the_permalink(); ?> "> <div class="score-label"><?php echo $fave_score_output; ?> </div> <img alt="<?php the_title(); ?> " class="featured-image" width="175" height="175" src="<?php echo fave_featured_image(get_the_ID(), 175, 175, true, true, true); ?> "> </a> </div> <?php } ?> </div> <div class="col-xs-8 col-sm-12 col-md-8 col-lg-8 no-padding-left"> <h2 class="post-title module-small-title"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h2> <?php if ($post_meta != 'no') { ?> <ul class="list-inline post-meta"> <?php get_template_part('inc/widgets', 'meta'); ?> </ul><!-- .post-meta --> <?php } ?> </div> </div> </div> <?php } } ?> <?php wp_reset_postdata(); ?> </div> <?php echo $after_widget; }
/** * Front-end display of widget **/ public function widget($args, $instance) { global $before_widget, $after_widget; extract($args); $items_num = $instance['items_num']; $default_active = $instance['default_active']; $post_meta = $instance['post_meta']; $popular = $instance['popular']; $latest = $instance['latest']; $review = $instance['review']; if ($default_active == 'popular') { $popular_tab = "in active"; } elseif ($default_active == 'letest') { $latest_tab = "in active"; } elseif ($default_active == 'reviews') { $review_tab = "in active"; } else { $popular_tab = "in active"; } echo $before_widget; /** * Latest Posts **/ //init the array $wp_query_args = array('ignore_sticky_posts' => 1); $wp_query_args['meta_key'] = 'fave_final_score'; $wp_query_args['orderby'] = 'meta_value_num'; $wp_query_args['order'] = 'DESC'; $wp_query_args['posts_per_page'] = $items_num; $qy_reviews = new WP_Query($wp_query_args); // Latest Posts $qy_latest = new WP_Query(array('post_type' => 'post', 'posts_per_page' => $items_num)); // Popular $wp_popular_args = array('ignore_sticky_posts' => 1); $wp_popular_args['meta_key'] = 'fave-post_views'; $wp_popular_args['orderby'] = 'meta_value_num'; $wp_popular_args['order'] = 'DESC'; $wp_popular_args['posts_per_page'] = $items_num; $qy_popular = new WP_Query($wp_popular_args); global $ft_option; ?> <div class="widget-tabs"> <div class="widget-body"> <!-- tabpanel --> <div role="tabpanel"> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <?php if ($popular != 1) { ?> <li role="presentation" class="<?php echo $popular_tab; ?> "><a href="#fave_tab1" aria-controls="fave_tab1" role="tab" data-toggle="tab"><?php _e('Popular posts', 'magzilla'); ?> </a></li> <?php } ?> <?php if ($latest != 1) { ?> <li role="presentation" class="<?php echo $latest_tab; ?> "><a href="#fave_tab2" aria-controls="tab2" role="tab" data-toggle="tab"><?php _e('Latest posts', 'magzilla'); ?> </a></li> <?php } ?> <?php if ($review != 1) { ?> <li role="presentation" class="<?php echo $review_tab; ?> "><a href="#fave_tab3" aria-controls="tab3" role="tab" data-toggle="tab"><?php _e('Reviews', 'magzilla'); ?> </a></li> <?php } ?> </ul> </div><!-- tabpanel --> <!-- Tab panes --> <div class="tab-content"> <?php if ($popular != 1) { ?> <div role="tabpanel" class="tab-pane fade <?php echo $popular_tab; ?> " id="fave_tab1"> <?php if ($qy_popular->have_posts()) { while ($qy_popular->have_posts()) { $qy_popular->the_post(); ?> <div class="latest-post"> <div class="row"> <div class="col-xs-4 col-sm-12 col-md-4 col-lg-4"> <?php if (has_post_thumbnail()) { ?> <div class="featured-image-wrap"> <?php if ($ft_option['widget_category'] != 0) { ?> <div class="category-label"><?php get_template_part('inc/post', 'cats'); ?> </div> <?php } ?> <a href="<?php echo esc_url(get_permalink()); ?> "> <img class="featured-image" width="175" height="175" src="<?php echo fave_featured_image(get_the_ID(), 175, 175, true, true, true); ?> " alt="<?php the_title(); ?> "> </a> </div> <?php } ?> </div> <div class="col-xs-8 col-sm-12 col-md-8 col-lg-8 no-padding-left"> <h2 class="post-title module-small-title"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h2> <?php if ($post_meta != 'no') { ?> <ul class="list-inline post-meta"> <?php get_template_part('inc/widgets', 'meta'); ?> </ul><!-- .post-meta --> <?php } ?> </div> </div> </div> <?php } } ?> <?php wp_reset_postdata(); ?> </div><!-- tab-pane fade --> <?php } ?> <?php if ($latest != 1) { ?> <div role="tabpanel" class="tab-pane fade <?php echo $latest_tab; ?> " id="fave_tab2"> <?php if ($qy_latest->have_posts()) { while ($qy_latest->have_posts()) { $qy_latest->the_post(); ?> <div class="latest-post"> <div class="row"> <div class="col-xs-4 col-sm-12 col-md-4 col-lg-4"> <?php if (has_post_thumbnail()) { ?> <div class="featured-image-wrap"> <?php if ($ft_option['widget_category'] != 0) { ?> <div class="category-label"><?php get_template_part('inc/post', 'cats'); ?> </div> <?php } ?> <a href="<?php echo esc_url(get_permalink()); ?> "> <img alt="<?php the_title(); ?> " class="featured-image" width="175" height="175" src="<?php echo fave_featured_image(get_the_ID(), 175, 175, true, true, true); ?> "> </a> </div> <?php } ?> </div> <div class="col-xs-8 col-sm-12 col-md-8 col-lg-8 no-padding-left"> <h2 class="post-title module-small-title"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h2> <?php if ($post_meta != 'no') { ?> <ul class="list-inline post-meta"> <?php get_template_part('inc/widgets', 'meta'); ?> </ul><!-- .post-meta --> <?php } ?> </div> </div> </div> <?php } } ?> <?php wp_reset_postdata(); ?> </div> <?php } ?> <?php if ($review != 1) { ?> <div role="tabpanel" class="tab-pane fade <?php echo $review_tab; ?> " id="fave_tab3"> <?php if ($qy_reviews->have_posts()) { while ($qy_reviews->have_posts()) { $qy_reviews->the_post(); $fave_score_display_type = get_post_meta(get_the_ID(), 'fave_score_display_type', true); $fave_final_score = get_post_meta(get_the_ID(), 'fave_final_score', true); $fave_final_score_override = get_post_meta(get_the_ID(), 'fave_final_score_override', true); /*if( !empty( $fave_final_score_override ) ) { $fave_final_score = $fave_final_score_override; }*/ $fave_review_final_score = intval($fave_final_score); if ($fave_score_display_type == 'percentage') { $fave_score_output = $fave_review_final_score . '%'; } if ($fave_score_display_type == 'points') { $fave_score_output = $fave_review_final_score / 10; } ?> <div class="latest-review"> <div class="row"> <div class="col-xs-4 col-sm-12 col-md-4 col-lg-4"> <?php if (has_post_thumbnail()) { ?> <div class="featured-image-wrap"> <a href="<?php the_permalink(); ?> "> <div class="score-label"><?php echo $fave_score_output; ?> </div> <img alt="<?php the_title(); ?> " class="featured-image" width="175" height="175" src="<?php echo fave_featured_image(get_the_ID(), 175, 175, true, true, true); ?> "> </a> </div> <?php } ?> </div> <div class="col-xs-8 col-sm-12 col-md-8 col-lg-8 no-padding-left"> <h2 class="post-title module-small-title"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h2> <?php if ($post_meta != 'no') { ?> <ul class="list-inline post-meta"> <?php get_template_part('inc/widgets', 'meta'); ?> </ul><!-- .post-meta --> <?php } ?> </div> </div> </div> <?php } } ?> <?php wp_reset_postdata(); ?> </div> <?php } ?> </div><!-- tab-content --> </div> </div> <?php echo $after_widget; }
function fav_module_6($atts, $content = null) { extract(shortcode_atts(array('category_id' => '', 'category_ids' => '', 'tag_slug' => '', 'sort' => '', 'autors_id' => '', 'posts_limit' => '', 'offset' => '', 'header_color' => '', 'header_text_color' => '', 'header_border_color' => '', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'title_style' => '', 'show_child_cat' => '', 'excerpt_limit' => '', 'image_size' => '', 'read_more' => '', 'module_meta' => '', 'author_name' => '', 'time_diff' => '', 'post_date' => '', 'post_time' => '', 'post_view_count' => '', 'post_comment_count' => '', 'module_bg' => '', 'module_padding' => ''), $atts)); ob_start(); //do the query $the_query = fave_data_source::get_wp_query($atts); //by ref do the query if ($image_size == '570_427') { $img_width = '570'; $img_height = '427'; } else { $img_width = '370'; $img_height = '277'; } $style = $bg = $padding = ''; if (!empty($module_bg)) { $bg = "background-color:" . $module_bg . ";"; } if (!empty($module_padding)) { $padding = "padding:" . $module_padding . ";"; } if (!empty($bg) || !empty($padding)) { $style = 'style="' . $bg . ' ' . $padding . '"'; } ?> <div class="module-6 module" <?php echo $style; ?> > <?php if ($hide_title != 'hide_title') { ?> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="module-top clearfix"> <?php //get the block title echo fave_get_block_title($atts); //get the sub category filter for this block echo fave_get_block_sub_cats($atts); ?> </div><!-- .module-top --> </div><!-- col-lg-12 col-md-12 col-sm-12 col-xs-12 --> </div><!-- .row --> <?php } ?> <?php while ($the_query->have_posts()) { $the_query->the_post(); $categories = get_the_category(get_the_ID()); $cats_html = ''; if ($categories) { foreach ($categories as $category) { $cat_id = $category->cat_ID; $cat_link = get_category_link($cat_id); $cats_html .= '<a class="cat-color-' . $cat_id . '" href="' . esc_url($cat_link) . '">' . esc_html($category->name) . '</a>'; } } ?> <div <?php post_class('row'); ?> <?php echo fave_get_item_scope(); ?> > <?php if (has_post_thumbnail()) { ?> <div class="col-lg-6 col-md-6 col-sm-5 col-xs-5"> <div class="featured-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <a href="<?php echo esc_url(get_permalink()); ?> "> <img itemprop="image" class="featured-image" width="<?php echo $img_width; ?> " height="<?php echo $img_height; ?> " src="<?php echo fave_featured_image(get_the_ID(), $img_width, $img_height, true, true, true); ?> " alt="<?php the_title(); ?> "> </a> </div><!-- featured-image-wrap --> </div><!-- col-lg-6 col-md-6 col-sm-5 col-xs-5 --> <?php } ?> <div class="col-lg-6 col-md-6 col-sm-7 col-xs-7"> <article> <div class="category-label-wrap"> <div class="category-label"><?php echo $cats_html; ?> </div> </div><!-- category-label-wrap --> <h2 itemprop="headline" class="post-title module-big-title"><a itemprop="url" href="<?php echo esc_url(get_permalink()); ?> "><?php the_title(); ?> </a></h2> <ul class="list-inline post-meta"> <?php fave_vc_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> <div class="post-content post-small-content" itemprop="articleBody"><p><?php echo fave_clean_excerpt($excerpt_limit, $read_more); ?> </p></div><!-- post-content --> </article><!-- .module-6-post --> </div><!-- col-lg-6 col-md-6 col-sm-7 col-xs-7 --> </div><!-- .row --> <?php } ?> </div><!-- .module-6 --> <?php $result = ob_get_contents(); ob_end_clean(); return $result; }
function fav_video_gallery($atts, $content = null) { extract(shortcode_atts(array('post_from' => '', 'category_id' => '', 'sort' => '', 'autors_id' => '', 'posts_limit' => '', 'offset' => '', 'playlist_title' => '', 'module_bg' => '', 'module_padding' => ''), $atts)); ob_start(); $video_link = $video_duration = ''; $wp_query_args = array('ignore_sticky_posts' => 1); if ($post_from == "category_videos" && !empty($category_id)) { $wp_query_args['tax_query'] = array(array('taxonomy' => 'video-categories', 'field' => 'term_id', 'terms' => $category_id)); } if ($post_from == "featured") { $wp_query_args['meta_key'] = 'fave_video_featured'; $wp_query_args['meta_value'] = '1'; } $current_day = date('j'); switch ($sort) { case 'popular': $wp_query_args['meta_key'] = 'fave-post_views'; $wp_query_args['orderby'] = 'meta_value_num'; $wp_query_args['order'] = 'DESC'; break; case 'review_high': $wp_query_args['meta_key'] = ''; $wp_query_args['orderby'] = 'meta_value_num'; $wp_query_args['order'] = 'DESC'; break; case 'random_posts': $wp_query_args['orderby'] = 'rand'; break; case 'alphabetical_order': $wp_query_args['orderby'] = 'title'; $wp_query_args['order'] = 'ASC'; break; case 'comment_count': $wp_query_args['orderby'] = 'comment_count'; $wp_query_args['order'] = 'DESC'; break; case 'random_today': $wp_query_args['orderby'] = 'rand'; $wp_query_args['year'] = date('Y'); $wp_query_args['monthnum'] = date('n'); $wp_query_args['day'] = date('j'); break; case 'random_7_day': $wp_query_args['orderby'] = 'rand'; $wp_query_args['date_query'] = array('column' => 'post_date_gmt', 'after' => '1 week ago'); break; } //custom pagination limit if (empty($posts_limit)) { $posts_limit = get_option('posts_per_page'); } $wp_query_args['posts_per_page'] = $posts_limit; // offset if (!empty($offset) and $paged > 1) { $wp_query_args['offset'] = $offset + ($paged - 1) * $posts_limit; } else { $wp_query_args['offset'] = $offset; } $wp_query_args['post_type'] = 'video'; $the_query_1 = new WP_Query($wp_query_args); $the_query = new WP_Query($wp_query_args); $unique_key = fave_unique_key(); $style = $bg = $padding = ''; if (!empty($module_bg)) { $bg = "background-color:" . $module_bg . ";"; } if (!empty($module_padding)) { $padding = "padding:" . $module_padding . ";"; } if (!empty($bg) || !empty($padding)) { $style = 'style="' . $bg . ' ' . $padding . '"'; } ?> <script type="text/javascript"> function htmlUpdateSize(){ // Get the dimensions of the viewport var height = jQuery(".player-holder-<?php echo $unique_key; ?> .player").height(); jQuery('.scroll-pane-<?php echo $unique_key; ?> ').css({ height: [height], }); }; jQuery(document).ready(htmlUpdateSize); // When the page first loads jQuery(window).resize(htmlUpdateSize); // When the browser changes size jQuery(document).ready(function($) { $( ".favethemes-video-<?php echo $unique_key; ?> a" ).click(function() { $(this).parent().addClass('selected').siblings().removeClass('selected'); $('#video-player-<?php echo $unique_key; ?> iframe').attr('src', $(this).attr('href')); return false; }); }); </script> <div class="featured-gallery video-gallery" <?php echo $style; ?> > <?php if (!empty($playlist_title)) { ?> <div class="video-gallery-top"> <div class="video-gallery-title"> <i class="fa fa-video-camera"></i> <?php echo esc_attr($playlist_title); ?> </div> </div> <?php } ?> <div id="video-player-<?php echo $unique_key; ?> " class="video-gallery-holder"> <div class="row row-no-padding"> <div class="col-xs-12 col-sm-8 col-md-8 col-lg-8"> <div class="player-holder player-holder-<?php echo $unique_key; ?> "> <div class="player"> <?php $i = 0; ?> <?php while ($the_query_1->have_posts()) { $the_query_1->the_post(); $i++; $video_channel = get_post_meta(get_the_ID(), 'fave_video_channel', true); $video_id = get_post_meta(get_the_ID(), 'fave_video_id', true); $video_duration = get_post_meta(get_the_ID(), 'fave_video_duration', true); if ($video_channel == 'vimeo') { $video_link = "https://player.vimeo.com/video/" . esc_attr($video_id) . "?color=ffcc3a"; } elseif ($video_channel == 'youtube') { $video_link = "https://www.youtube.com/embed/" . esc_attr($video_id) . ""; } else { $video_link = ""; } ?> <iframe src="<?php echo esc_url($video_link); ?> " frameborder="0" allowfullscreen></iframe> <?php if ($i == 1) { break; } ?> <?php } ?> </div> </div> </div> <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4"> <div class="playlist-holder scroll-pane scroll-pane-<?php echo esc_attr($unique_key); ?> "> <?php $i = 0; ?> <?php while ($the_query->have_posts()) { $the_query->the_post(); $i++; $video_channel = get_post_meta(get_the_ID(), 'fave_video_channel', true); $video_id = get_post_meta(get_the_ID(), 'fave_video_id', true); $video_duration = get_post_meta(get_the_ID(), 'fave_video_duration', true); if ($video_channel == 'vimeo') { $video_link = "https://player.vimeo.com/video/" . esc_attr($video_id) . "?color=ffcc3a"; } elseif ($video_channel == 'youtube') { $video_link = "https://www.youtube.com/embed/" . esc_attr($video_id) . ""; } else { $video_link = ""; } ?> <div class="playlist-video favethemes-video-<?php echo esc_attr($unique_key); ?> <?php if ($i == 1) { echo "selected"; } ?> "> <a href="<?php echo esc_url($video_link); ?> "> <div class="media"> <div class="media-left"> <img class="media-object" src="<?php echo fave_featured_image(get_the_ID(), 160, 90, true, true, true); ?> " alt="<?php the_title(); ?> " alt="<?php the_title(); ?> "> </div> <div class="media-body"> <div class="media-heading"><?php the_title(); ?> </div> <?php if (!empty($video_duration)) { ?> <i class="fa fa-clock-o"></i> <?php echo esc_attr($video_duration); ?> <?php } ?> </div> </div> </a> </div><!-- playlist-video --> <?php } ?> </div> </div> </div> </div> </div> <?php $result = ob_get_contents(); ob_end_clean(); return $result; }
function fav_grids($atts, $content = null) { extract(shortcode_atts(array('grid_type' => '', 'post_from' => '', 'category_id' => '', 'category_ids' => '', 'hide_meta' => '', 'hide_cat' => '', 'sort' => '', 'posts_limit' => '', 'module_meta' => '', 'author_name' => '', 'time_diff' => '', 'post_date' => '', 'post_time' => '', 'post_view_count' => '', 'post_comment_count' => '', 'module_bg' => '', 'module_padding' => ''), $atts)); ob_start(); $style = $bg = $padding = ''; if (!empty($module_bg)) { $bg = "background-color:" . $module_bg . ";"; } if (!empty($module_padding)) { $padding = "padding:" . $module_padding . ";"; } if (!empty($bg) || !empty($padding)) { $style = 'style="' . $bg . ' ' . $padding . '"'; } //do the query $wp_query_args = array('ignore_sticky_posts' => 1); if ($post_from == "category_posts") { if (!empty($category_id) and empty($category_ids)) { $category_ids = $category_id; } if (!empty($category_ids)) { $wp_query_args['cat'] = $category_ids; } } if ($post_from == "featured") { $wp_query_args['meta_key'] = 'fave_featured'; $wp_query_args['meta_value'] = '1'; } $current_day = date('j'); switch ($sort) { case 'popular': $wp_query_args['meta_key'] = 'fave-post_views'; $wp_query_args['orderby'] = 'meta_value_num'; $wp_query_args['order'] = 'DESC'; break; case 'review_high': $wp_query_args['meta_key'] = ''; //td_review::$td_review_key; $wp_query_args['orderby'] = 'meta_value_num'; $wp_query_args['order'] = 'DESC'; break; case 'random_posts': $wp_query_args['orderby'] = 'rand'; break; case 'alphabetical_order': $wp_query_args['orderby'] = 'title'; $wp_query_args['order'] = 'ASC'; break; case 'comment_count': $wp_query_args['orderby'] = 'comment_count'; $wp_query_args['order'] = 'DESC'; break; case 'random_today': $wp_query_args['orderby'] = 'rand'; $wp_query_args['year'] = date('Y'); $wp_query_args['monthnum'] = date('n'); $wp_query_args['day'] = date('j'); break; case 'random_7_day': $wp_query_args['orderby'] = 'rand'; $wp_query_args['date_query'] = array('column' => 'post_date_gmt', 'after' => '1 week ago'); break; } //custom pagination limit if (empty($posts_limit)) { $posts_limit = get_option('posts_per_page'); } $wp_query_args['posts_per_page'] = $posts_limit; $the_query = new WP_Query($wp_query_args); ?> <?php if ($grid_type == "grid_1") { ?> <div class="grid-banner magzilla-grid-1" <?php echo $style; ?> > <div class="row row-no-padding"> <?php $i = 0; ?> <?php while ($the_query->have_posts()) { $the_query->the_post(); $i++; if ($i == 1 || $i == 6) { $grid_classes = "col-lg-6 col-md-6 col-sm-6 col-xs-12 grid-1-big"; $img_width = '585'; $img_height = '285'; if (has_post_thumbnail()) { $featured_image = fave_featured_image(get_the_ID(), 585, 285, true, true, true); } else { $featured_image = 'http://placehold.it/585x284'; } } else { $grid_classes = "col-lg-3 col-md-3 col-sm-3 col-xs-6 grid-1-small"; $img_width = '290'; $img_height = '285'; if (has_post_thumbnail()) { $featured_image = fave_featured_image(get_the_ID(), 290, 285, true, true, true); } else { $featured_image = 'http://placehold.it/293x285'; } } if ($i == 6) { $i = 0; } ?> <div class="<?php echo esc_attr($grid_classes); ?> "> <div <?php post_class('thumb'); ?> <?php echo fave_get_item_scope(); ?> > <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "></a> <div class="thumb-content"> <?php if ($hide_cat != 'no') { ?> <div class="category-label"> <?php get_template_part('inc/post', 'cats'); ?> </div> <?php } ?> <h2 itemprop="headline" class="gallery-title-small"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($hide_meta != 'no') { ?> <ul class="list-inline post-meta"> <?php fave_vc_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> <?php } ?> </div> <?php if (has_post_thumbnail()) { ?> <div class="slide-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <img itemprop="image" class="featured-image lazyOwl" width="<?php echo $img_width; ?> " height="<?php echo $img_height; ?> " data-src="<?php echo $featured_image; ?> " src="<?php echo $featured_image; ?> " alt="<?php the_title(); ?> "> </div><!-- slide-image-wrap --> <?php } ?> </div> </div> <?php } ?> <?php /* Restore original Post Data */ wp_reset_postdata(); ?> </div> </div> <?php } elseif ($grid_type == "grid_2") { ?> <div class="grid-banner magzilla-grid-2" <?php echo $style; ?> > <div class="row row-no-padding"> <?php $i = 0; ?> <?php while ($the_query->have_posts()) { $the_query->the_post(); $i++; if ($i == 1 || $i == 2) { $grid_classes = "col-lg-6 col-md-6 col-sm-12 col-xs-12 grid-2-big"; $img_width = '585'; $img_height = '285'; if (has_post_thumbnail()) { $featured_image = fave_featured_image(get_the_ID(), 585, 285, true, true, true); } else { $featured_image = 'http://placehold.it/720x350'; } } else { $grid_classes = "col-lg-3 col-md-3 col-sm-6 col-xs-12 grid-2-small"; $img_width = '293'; $img_height = '285'; if (has_post_thumbnail()) { $featured_image = fave_featured_image(get_the_ID(), 293, 285, true, true, true); } else { $featured_image = 'http://placehold.it/450x438'; } } if ($i == 6) { $i = 0; } ?> <div class="<?php echo esc_attr($grid_classes); ?> "> <div <?php post_class('thumb'); ?> <?php echo fave_get_item_scope(); ?> > <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "></a> <div class="thumb-content"> <?php if ($hide_cat != 'no') { ?> <div class="category-label"> <?php get_template_part('inc/post', 'cats'); ?> </div> <?php } ?> <h2 itemprop="headline" class="gallery-title-small"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($hide_meta != 'no') { ?> <ul class="list-inline post-meta"> <?php fave_vc_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> <?php } ?> </div> <?php if (has_post_thumbnail()) { ?> <div class="slide-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <img itemprop="image" class="featured-image lazyOwl" width="<?php echo $img_width; ?> " height="<?php echo $img_height; ?> " data-src="<?php echo $featured_image; ?> " src="<?php echo $featured_image; ?> " alt="<?php the_title(); ?> "> </div><!-- slide-image-wrap --> <?php } ?> </div> </div> <?php } ?> <?php /* Restore original Post Data */ wp_reset_postdata(); ?> </div> </div> <?php } ?> <?php $result = ob_get_contents(); ob_end_clean(); return $result; }
function start_el(&$output, $object, $depth = 0, $args = array(), $id = 0) { parent::start_el($output, $object, $depth, $args); $fave_menu_type = $object->favemenutype; $fave_cat_id = $object->favemegamenu; $no_of_posts = $object->nav_no_of_posts; $fave_posts = $main_posts = $cat_main = $cat_list = $posts_area = $posts_area_end = NULL; $fave_subcategories = get_categories(array('child_of' => $fave_cat_id)); $sub_cats_array = array(); foreach ($fave_subcategories as $key => $cat_val) { $sub_cats_array[$cat_val->name] = $cat_val->term_id; } $parant_cat = array($fave_cat_id); $merge_cat_ids = array_merge($parant_cat, $sub_cats_array); if ($fave_menu_type == 3) { if ($fave_cat_id != NULL) { $j = 0; foreach ($merge_cat_ids as $fave_cat_id) { $fave_posts = ''; $j++; if ($j == 1) { $active = 'active in'; $no_of_posts = $no_of_posts; } else { $active = ''; $no_of_posts = 4; } $fave_args = array('cat' => $fave_cat_id, 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $no_of_posts, 'ignore_sticky_posts' => 1); $fave_qry_latest = $mzine_img = NULL; $fave_qry_latest = new WP_Query($fave_args); $i = 1; $featured_image = ''; if ($no_of_posts > 4 || $no_of_posts == '') { $css_classes = 'slide'; } else { $css_classes = 'col-xs-3 col-sm-3 col-md-3 col-lg-3'; } while ($fave_qry_latest->have_posts()) { $fave_qry_latest->the_post(); $menu_categories = get_the_category(get_the_ID()); $menu_cats_html = ''; if ($menu_categories) { foreach ($menu_categories as $category) { $cat_id = $category->cat_ID; $cat_link = get_category_link($cat_id); $menu_cats_html .= '<a class="cat-color-' . intval($cat_id) . '" href="' . esc_url($cat_link) . '">' . esc_html($category->name) . '</a>'; } } if ('gallery' == get_post_format()) { // Gallery $article_icon = '<div class="post-type-icon"><i class="fa fa-picture-o"></i></div>'; } elseif ('video' == get_post_format()) { // Video $article_icon = '<div class="post-type-icon"><i class="fa fa-video-camera"></i></div>'; } elseif ('audio' == get_post_format()) { // Audio $article_icon = '<div class="post-type-icon"><i class="fa fa-microphone"></i></div>'; } elseif ('link' == get_post_format()) { // Link $article_icon = '<div class="post-type-icon"><i class="fa fa-link"></i></div>'; } else { $article_icon = ''; } $fave_permalink = get_permalink(get_the_ID()); if (has_post_thumbnail()) { $thumbnail = fave_featured_image(get_the_ID(), 260, 195, true, true, true); $featured_image = '<div class="featured-image-wrap"> ' . $article_icon . ' <div class="category-label">' . $menu_cats_html . '</div> <a href="' . $fave_permalink . '"> <img class="featured-image lazyOwl" width="260" height="195" src="' . esc_url($thumbnail) . '" alt="' . get_the_title() . '"> </a> </div>'; } $fave_posts .= '<div class="' . $css_classes . '"> <div class="menu-post"> ' . $featured_image . ' <article class="post"> <h2 class="post-title module-small-title"><a href="' . esc_url($fave_permalink) . '">' . get_the_title() . '</a></h2> </article> </div> </div>'; $i++; } wp_reset_postdata(); if ($no_of_posts > 4 || $no_of_posts == '') { $rnr_id = fave_unique_key(); if (is_rtl()) { $magzilla_rtl = 'true'; } else { $magzilla_rtl = 'false'; } ?> <script> jQuery(document).ready(function($) { $('#owl-carousel-menu-<?php echo esc_attr($rnr_id); ?> ').owlCarousel({ rtl: <?php echo $magzilla_rtl; ?> , loop: false, touchDrag: false, responsive:{ 0:{ items:2 }, 479:{ items:4 }, 768:{ items:4 }, 980:{ items:4 }, 1199:{ items:4 } }, //Autoplay autoPlay : false, autoplayHoverPause : true, // Navigation nav : true, navText : ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"], navRewind : true, dots: false, // Responsive responsiveClass:true, responsiveRefreshRate : 200, responsiveBaseElement: window, //Lazy load lazyLoad : true, lazyFollow : true, lazyEffect : "fade", }); }); </script> <?php $slider_wrap = '<div id="owl-carousel-menu-' . esc_attr($rnr_id) . '" class="owl-carousel owl-carousel-menu">'; $slider_wrap_end = '</div>'; } else { $slider_wrap = $slider_wrap_end = ''; } $main_posts .= '<div role="tabpanel" class="tab-pane fade ' . esc_attr($active) . '" id="tab' . esc_attr($fave_cat_id) . '"> <div class="row-sub-menu"> ' . $slider_wrap . ' ' . $fave_posts . ' ' . $slider_wrap_end . ' </div> </div>'; } } // End $fave_cat_id = null } // End $fave_menu_type == 3 if ($fave_posts != NULL) { if (!empty($fave_subcategories)) { $posts_area = '<div class="col-xs-10 col-sm-10 col-md-10 col-lg-10 mega_menu"><div class="tab-content">'; $posts_area_end = '</div></div>'; $fave_cat = $object->favemegamenu; $cat_list .= '<li role="presentation" class="tab-link active">'; $cat_list .= '<a href="#tab' . esc_attr($fave_cat) . '" role="tab" data-toggle="tab" aria-expanded="true">' . __('All', 'magzilla') . '</a>'; $cat_list .= '</li>'; foreach ($fave_subcategories as $key => $value) { $cat_list .= '<li role="presentation" class="tab-link">'; $cat_list .= '<a href="#tab' . esc_attr($value->term_id) . '" role="tab" data-toggle="tab" aria-expanded="false">' . esc_attr($value->name) . '</a>'; $cat_list .= '</li>'; } $cat_main .= '<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">'; $cat_main .= '<ul class="nav menu-tab-nav text-right" role="tablist">'; $cat_main .= $cat_list; $cat_main .= '</ul>'; $cat_main .= '</div>'; } $output .= '<ul class="dropdown-menu"><li> <div class="yamm-content"> <div class="row"> ' . $cat_main . ' ' . $posts_area . ' ' . $main_posts . ' ' . $posts_area_end . ' </div> </div> </li></ul>'; } }
function fav_gallery_module_1($atts, $content = null) { extract(shortcode_atts(array('module_7_type' => '', 'category_id' => '', 'sort' => '', 'autors_id' => '', 'posts_limit' => '', 'offset' => '', 'header_color' => '', 'header_text_color' => '', 'header_border_color' => '', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'show_child_cat' => '', 'title_style' => '', 'image_size' => '', 'pagination' => '', 'module_space' => '', 'module_meta' => '', 'author_name' => '', 'time_diff' => '', 'post_date' => '', 'post_time' => '', 'post_view_count' => '', 'post_comment_count' => '', 'text_align' => '', 'module_bg' => '', 'module_padding' => ''), $atts)); ob_start(); if ($module_7_type == "two_columns") { $css_classes = "col-lg-6 col-md-6 col-sm-6 col-xs-6"; $image_thumb_size = "big-thumb"; } elseif ($module_7_type == "one_columns") { $css_classes = "col-lg-12 col-md-12 col-sm-12 col-xs-12"; $image_thumb_size = "big-thumb"; } else { $css_classes = "col-lg-4 col-md-4 col-sm-6 col-xs-6"; $image_thumb_size = "small-thumb"; } if ($image_size == '570_428') { $image_width = '570'; $image_height = '428'; } else { $image_width = '370'; $image_height = '278'; } $style = $bg = $padding = ''; if (!empty($module_bg)) { $bg = "background-color:" . $module_bg . ";"; } if (!empty($module_padding)) { $padding = "padding:" . $module_padding . ";"; } if (!empty($bg) || !empty($padding)) { $style = 'style="' . $bg . ' ' . $padding . '"'; } // Pagination if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } else { $paged = 1; } query_posts(fave_gallery_post_type_data_source::metabox_to_args($atts, $paged)); ?> <div class="module gallery-4 <?php echo $text_align; ?> main-box-for-load-more" <?php echo $style; ?> > <?php if ($hide_title != 'hide_title') { ?> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="module-top clearfix"> <?php echo fave_get_gallery_block_title($atts); ?> <?php echo fave_get_gallery_block_sub_cats($atts); ?> </div><!-- .module-top --> </div><!-- col-lg-12 col-md-12 col-sm-12 col-xs-12 --> </div><!-- .row --> <?php } ?> <div class="row <?php if (!empty($module_space)) { echo esc_attr($module_space); } ?> "> <div class="fave-loop-wrap"> <div class="fave-post"> <?php while (have_posts()) { the_post(); ?> <div class="<?php echo esc_attr($css_classes); ?> "> <div class="thumb <?php echo esc_attr($image_thumb_size); ?> "> <a href="<?php echo esc_url(get_permalink()); ?> "></a> <div class="thumb-content"> <h2 class="gallery-title-small"><a href="<?php echo esc_url(get_permalink()); ?> "><?php the_title(); ?> </a></h2> <ul class="list-inline post-meta hidden-xs hidden-sm hidden-md"> <?php fave_vc_gallery_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> </div> <div class="slide-image-wrap slider-with-animation "> <div class="post-type-icon"><i class="fa fa-picture-o"></i></div> <img class="featured-image" width="<?php echo $image_width; ?> " height="<?php echo $image_height; ?> " alt="<?php the_title(); ?> " src="<?php echo fave_featured_image(get_the_ID(), $image_width, $image_height, true, true, true); ?> "> </div><!-- slide-image-wrap --> </div><!-- thumb --> </div><!-- col-lg-4 col-md-4 col-sm-6 col-xs-6 --> <?php } ?> </div> </div> </div><!-- row --> <?php if (!empty($pagination)) { ?> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <?php get_template_part('inc/pagination/' . $pagination); ?> </div> </div> <?php } ?> </div><!-- .module-7 --> <?php wp_reset_query(); $result = ob_get_contents(); ob_end_clean(); return $result; }
function fav_module_9($atts, $content = null) { extract(shortcode_atts(array('module_9_type' => '', 'category_id' => '', 'category_ids' => '', 'tag_slug' => '', 'sort' => '', 'autors_id' => '', 'posts_limit' => '', 'offset' => '', 'header_color' => '', 'header_text_color' => '', 'header_border_color' => '', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'title_style' => '', 'module_space' => '', 'module_meta' => '', 'author_name' => '', 'time_diff' => '', 'post_date' => '', 'post_time' => '', 'post_view_count' => '', 'post_comment_count' => '', 'module_bg' => '', 'module_padding' => ''), $atts)); ob_start(); $css_class_3 = ''; if ($module_9_type == "sidebar_template") { $css_class_1 = "col-lg-9 col-md-9 col-sm-12 col-xs-12"; $css_class_2 = "col-lg-3 col-md-3 col-sm-12 col-xs-12"; $css_class_3 = "with-sidebar"; $image_1_width = '570'; $image_1_height = '354'; $image_2_width = '170'; $image_2_height = '103'; } else { $css_class_1 = "col-lg-6 col-md-6 col-sm-12 col-xs-12"; $css_class_2 = "col-lg-2 col-md-2 col-sm-12 col-xs-12"; $image_1_width = '570'; $image_1_height = '428'; $image_2_width = '170'; $image_2_height = '125'; } $style = $bg = $padding = ''; if (!empty($module_bg)) { $bg = "background-color:" . $module_bg . ";"; } if (!empty($module_padding)) { $padding = "padding:" . $module_padding . ";"; } if (!empty($bg) || !empty($padding)) { $style = 'style="' . $bg . ' ' . $padding . '"'; } //do the query $the_query = fave_data_source::get_wp_query($atts); //by ref do the query ?> <div class="module-9 module gallery" <?php echo $style; ?> > <?php if ($hide_title != 'hide_title') { ?> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="module-top clearfix"> <?php //get the block title echo fave_get_block_title($atts); ?> </div><!-- .module-top --> </div><!-- col-lg-12 col-md-12 col-sm-12 col-xs-12 --> </div><!-- .row --> <?php } ?> <div class="row <?php if (!empty($module_space)) { echo $module_space; } ?> "> <?php $count = 0; while ($the_query->have_posts()) { $the_query->the_post(); $count++; ?> <div <?php post_class($css_class_1); ?> <?php echo fave_get_item_scope(); ?> > <div class="thumb big-thumb <?php echo esc_attr($css_class_3); ?> "> <a href="<?php echo esc_url(get_permalink()); ?> "></a> <div class="thumb-content"> <h2 itemprop="headline" class="gallery-title-small"><a itemprop="url" href="<?php echo esc_url(get_permalink()); ?> "><?php the_title(); ?> </a></h2> <ul class="list-inline post-meta"> <?php fave_vc_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> </div> <div class="slide-image-wrap slider-with-animation"> <?php get_template_part('inc/article', 'icon'); ?> <img itemprop="image" class="featured-image" width="<?php echo $image_1_width; ?> " height="<?php echo $image_1_height; ?> " src="<?php echo fave_featured_image(get_the_ID(), $image_1_width, $image_1_height, true, true, true); ?> " alt="<?php the_title(); ?> "> </div><!-- slide-image-wrap --> </div><!-- thumb --> </div> <?php if ($count == 1) { break; } } ?> <?php $total_posts = $the_query->post_count; $loop = $post_counter = 0; ?> <?php while ($the_query->have_posts()) { $the_query->the_post(); $loop++; $post_counter++; ?> <?php if ($loop == 1) { ?> <div class="<?php echo esc_attr($css_class_2); ?> "> <?php } ?> <div <?php post_class('thumb small-thumb'); ?> <?php echo fave_get_item_scope(); ?> > <a href="<?php echo esc_url(get_permalink()); ?> "></a> <div class="thumb-content"> <h2 itemprop="headline" class="gallery-title-small"><a itemprop="url" href="<?php echo esc_url(get_permalink()); ?> "><?php the_title(); ?> </a></h2> <meta content="<?php the_time('Y-m-d '); ?> " itemprop="datePublished"> </div> <div class="slide-image-wrap slider-with-animation"> <?php get_template_part('inc/article', 'icon'); ?> <img itemprop="image" class="featured-image" width="<?php echo $image_2_width; ?> " height="<?php echo $image_2_height; ?> " src="<?php echo fave_featured_image(get_the_ID(), $image_2_width, $image_2_height, true, true, true); ?> " alt="<?php the_title(); ?> "> </div><!-- slide-image-wrap --> </div><!-- thumb --> <?php if ($loop == 3 || $post_counter == $total_posts - 1) { $loop = 0; ?> </div> <?php } ?> <?php } ?> <?php /* Restore original Post Data */ wp_reset_postdata(); ?> </div><!-- .row --> </div><!-- .module-9 --> <?php $result = ob_get_contents(); ob_end_clean(); return $result; }
"><?php the_title(); ?> </a></h2> <ul class="list-inline post-meta hidden-xs hidden-sm hidden-md"> <?php get_template_part('inc/cat', 'meta'); ?> </ul><!-- .post-meta --> </div> <div class="slide-image-wrap"> <?php get_template_part('inc/article', 'icon'); ?> <img itemprop="image" class="featured-image" width="370" height="278" src="<?php echo fave_featured_image(get_the_ID(), 370, 278, true, true, true); ?> " alt="<?php the_title(); ?> "> </div><!-- slide-image-wrap --> </div><!-- thumb --> </div> <?php } } ?> </div><!-- .fave-post --> </div><!-- .fave-loop-wrap -->
function fav_video_module_3($atts, $content = null) { extract(shortcode_atts(array('module_9_type' => '', 'category_id' => '', 'sort' => '', 'autors_id' => '', 'posts_limit' => '', 'offset' => '', 'header_color' => '', 'header_text_color' => '', 'header_border_color' => '', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'title_style' => '', 'module_space' => '', 'module_meta' => '', 'author_name' => '', 'time_diff' => '', 'post_date' => '', 'post_time' => '', 'post_view_count' => '', 'post_comment_count' => '', 'module_bg' => '', 'module_padding' => ''), $atts)); ob_start(); $css_class_3 = ''; if ($module_9_type == "sidebar_template") { $css_class_1 = "col-lg-9 col-md-9 col-sm-12 col-xs-12"; $css_class_2 = "col-lg-3 col-md-3 col-sm-12 col-xs-12"; $css_class_3 = "with-sidebar"; } else { $css_class_1 = "col-lg-6 col-md-6 col-sm-12 col-xs-12"; $css_class_2 = "col-lg-2 col-md-2 col-sm-12 col-xs-12"; } $style = $bg = $padding = ''; if (!empty($module_bg)) { $bg = "background-color:" . $module_bg . ";"; } if (!empty($module_padding)) { $padding = "padding:" . $module_padding . ";"; } if (!empty($bg) || !empty($padding)) { $style = 'style="' . $bg . ' ' . $padding . '"'; } //do the query $the_query = fave_video_post_type_data_source::get_wp_query($atts); //by ref do the query ?> <div class="module-9 video" <?php echo $style; ?> > <?php if ($hide_title != 'hide_title') { ?> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="module-top clearfix"> <?php //get the block title echo fave_get_video_block_title($atts); ?> </div><!-- .module-top --> </div><!-- col-lg-12 col-md-12 col-sm-12 col-xs-12 --> </div><!-- .row --> <?php } ?> <div class="row <?php if (!empty($module_space)) { echo $module_space; } ?> "> <?php $count = 0; while ($the_query->have_posts()) { $the_query->the_post(); $count++; ?> <div class="<?php echo $css_class_1; ?> "> <div class="thumb big-thumb <?php echo $css_class_3; ?> "> <a href="<?php echo esc_url(get_permalink()); ?> "></a> <div class="thumb-content"> <h2 class="gallery-title-small"><a href="<?php echo esc_url(get_permalink()); ?> "><?php the_title(); ?> </a></h2> <ul class="list-inline post-meta"> <?php fave_vc_video_modules_meta($module_meta, $author_name, $time_diff, $post_date, $post_time, $post_view_count, $post_comment_count); ?> </ul><!-- .post-meta --> </div> <div class="slide-image-wrap slider-with-animation"> <img class="featured-image" src="<?php echo fave_featured_image(get_the_ID(), 722, 406, true, true, true); ?> " alt="<?php the_title(); ?> "> </div><!-- slide-image-wrap --> </div><!-- thumb --> </div> <?php if ($count == 1) { break; } } ?> <?php $posts_limit = $posts_limit - 1; $loop = $post_counter = 0; ?> <?php while ($the_query->have_posts()) { $the_query->the_post(); $loop++; $post_counter++; ?> <?php if ($loop == 1) { ?> <div class="<?php echo $css_class_2; ?> "> <?php } ?> <div class="thumb small-thumb" > <a href="<?php echo esc_url(get_permalink()); ?> "></a> <div class="thumb-content"> <h2 class="gallery-title-small"><a href="<?php echo esc_url(get_permalink()); ?> "><?php the_title(); ?> </a></h2> </div> <div class="slide-image-wrap slider-with-animation"> <div class="post-type-icon"><i class="fa fa-video-camera"></i></div> <img class="featured-image" src="<?php echo fave_featured_image(get_the_ID(), 227, 127, true, true, true); ?> " alt="<?php the_title(); ?> "> </div><!-- slide-image-wrap --> </div><!-- thumb --> <?php if ($loop == 3 || $post_counter == $posts_limit) { $loop = 0; ?> </div> <?php } ?> <?php } ?> <?php /* Restore original Post Data */ wp_reset_postdata(); ?> </div><!-- .row --> </div><!-- .module-9 --> <?php $result = ob_get_contents(); ob_end_clean(); return $result; }