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; }
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_gallery_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"; $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_gallery_post_type_data_source::get_wp_query($atts); //by ref do the query ?> <div class="module-9 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_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 <?php if (!empty($module_space)) { echo esc_attr($module_space); } ?> "> <?php $count = 0; while ($the_query->have_posts()) { $the_query->the_post(); $count++; ?> <div class="<?php echo esc_attr($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_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_1_width; ?> " height="<?php echo $image_1_height; ?> " alt="<?php the_title(); ?> " src="<?php echo fave_featured_image(get_the_ID(), $image_1_width, $image_1_height, true, true, true); ?> "> </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 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-picture-o"></i></div> <img class="featured-image" width="<?php echo $image_2_width; ?> " height="<?php echo $image_2_height; ?> " alt="<?php the_title(); ?> " src="<?php echo fave_featured_image(get_the_ID(), $image_2_width, $image_2_height, true, true, true); ?> "> </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; }