function widget($args, $instance) { extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $orderby = $instance['orderby']; $count = $instance['count']; $display = $instance['display']; $cats = isset($instance['cats']) ? $instance['cats'] : array(); $layout = isset($instance['layout']) ? $instance['layout'] : ''; $sidebar_size = isset($instance['sidebar_size']) ? $instance['sidebar_size'] : ''; $tag = isset($instance['tag']) ? $instance['tag'] : ''; $output = get_transient('mom-posts-widget-' . $this->id); if ($orderby == 'random') { $output = false; } if ($output == false) { ob_start(); /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ($title) { echo $before_title . $title . $after_title; } ?> <ul class="post-list jw2 <?php echo $layout; ?> "> <?php global $unique_posts; global $do_unique_posts; $dateformat = mom_option('date_format'); $post_meta_hp = mom_option('post_meta_hp'); if ($post_meta_hp == 1) { $post_head = mom_option('post_head'); $post_head_author = mom_option('post_head_author'); $post_head_date = mom_option('post_head_date'); $post_head_cat = mom_option('post_head_cat'); $post_head_commetns = mom_option('post_head_commetns'); $post_head_views = mom_option('post_head_views'); } else { $post_head = 1; $post_head_author = 1; $post_head_date = 1; $post_head_cat = 1; $post_head_commetns = 1; $post_head_views = 1; } if ($orderby == 'popular') { if ($display == 'cats') { $catsi = implode(',', $cats); $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "comment_count", 'cat' => $catsi); } elseif ($display == 'tag') { $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "comment_count", 'tag' => $tag); } else { $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "comment_count"); } } elseif ($orderby == 'random') { if ($display == 'cats') { $catsi = implode(',', $cats); $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "rand", 'cat' => $catsi); } elseif ($display == 'tag') { $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "rand", 'tag' => $tag); } else { $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "rand"); } } elseif ($orderby == 'views') { $views_key = 'post_views_count'; if (function_exists('the_views')) { $views_key = 'views'; } if ($display == 'cats') { $catsi = implode(',', $cats); $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'cat' => $catsi, 'meta_key' => $views_key, 'orderby' => 'meta_value_num', 'order' => 'DESC'); } elseif ($display == 'tag') { $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'tag' => $tag, 'meta_key' => $views_key, 'orderby' => 'meta_value_num', 'order' => 'DESC'); } else { $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'meta_key' => $views_key, 'orderby' => 'meta_value_num', 'order' => 'DESC'); } } else { if ($display == 'cats') { $catsi = implode(',', $cats); $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'cat' => $catsi); } elseif ($display == 'tag') { $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'tag' => $tag); } else { $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts); } } // JWOOL - added for custom post types $args['post_type'] = array('post', 'appearance', 'program'); $query = new WP_Query($args); update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } if ($sidebar_size == 'small') { $img_size = 'postlist-thumb'; if ($layout == 'full') { $img_size = 'postlist-thumb'; } } elseif ($sidebar_size == 'big') { $img_size = 'postpicwid-thumb'; if ($layout == 'full') { $img_size = 'sliderwidget-thumb'; } } else { $img_size = 'postlist-thumb'; if ($layout == 'full') { $img_size = 'sliderwidget-thumb'; } } ?> <li itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a itemprop="url" href="<?php the_permalink(); ?> " rel="bookmark"> <?php mom_post_image_full($img_size); ?> </a></figure> <?php } ?> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h2> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php the_time($dateformat); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php the_permalink(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> <a href="<?php the_permalink(); ?> " class="read-more-link"><?php _e('Read more...', 'framework'); ?> </a> </li> <?php } ?> <?php } else { ?> <!-- Else in here --> <?php } ?> <?php wp_reset_query(); ?> </ul> <?php /* After widget (defined by themes). */ echo $after_widget; $output = ob_get_contents(); ob_end_clean(); set_transient('mom-posts-widget-' . $this->id, $output, 60 * 60 * 24); } echo $output; }
function mom_feature_slider($atts, $content = null) { global $unique_posts; global $do_unique_posts; extract(shortcode_atts(array('id' => '', 'type' => 'def', 'display' => 'latest', 'cats' => '', 'tag' => '', 'specific' => '', 'orderby' => '', 'number_of_posts' => '', 'animation' => '', 'animationin' => '', 'animationout' => '', 'autoplay' => '', 'timeout' => '4000', 'cap' => 'yes', 'exc' => '', 'class' => '', 'num_bullets' => '', 'bullets_event' => ''), $atts)); if ($id == '') { static $id = 75; $id++; } $specific = explode(',', $specific); if ($type == 'cat') { wp_enqueue_script('cycle'); wp_enqueue_script('nicescroll'); } if ($cats == 'Select a Category') { $cats = ''; } if ($tag == 'Select a Tag') { $tag = ''; } $output = get_transient('mom_feature_sliders' . $id . $type . $display . $cats . $tag . $class . $orderby); if ($orderby == 'rand') { $output = false; } if ($output == false) { ob_start(); if ($num_bullets == 'yes') { $class .= ' numbers_bullets'; } if (is_rtl()) { $rtl = 'true'; } else { $rtl = 'false'; } if ($animation == 'fade') { $animationout = 'fadeOut'; $animationin = ''; } elseif ($animation == 'slide') { $animationout = ''; $animationin = ''; } elseif ($animation == 'flip') { $animationout = 'slideOutDown'; $animationin = 'flipInX'; } if ($autoplay == 'no') { $autoplay = 'false'; } else { $autoplay = 'true'; } $post_meta_hp = mom_option('post_meta_hp'); if ($post_meta_hp == 1) { $post_head = mom_option('post_head'); $post_head_date = mom_option('post_head_date'); } else { $post_head = 1; $post_head_date = 1; } ?> <?php if ($type == 'slider2') { ?> <!-- Full width Slider 2 --> <section class="section <?php echo $class; ?> feature_slider_<?php echo $id; ?> "><!--def slider--> <div class="slider2 clearfix"> <!-- slider2 wrap --> <?php if ($display == 'cat') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'specific') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'post__in' => $specific, 'posts_per_page' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <?php if (mom_post_image() != false) { ?> <div class="def-slider-item big-slider2" itemscope="" itemtype="http://schema.org/Article"> <a itemprop="url" href="<?php the_permalink(); ?> "> <?php mom_post_image_full('catslider-thumb'); ?> </a> <?php if ($cap != 'no') { ?> <div class="def-slider-cap"> <div class="def-slider-title"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> </div> <?php if ($exc != false) { ?> <p class="def-slider-desc"> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } echo wp_html_excerpt(strip_shortcodes($excerpt), $exc); ?> ... </p> <?php } ?> </div> <?php } ?> </div> <?php } ?> <?php } } else { } wp_reset_postdata(); ?> <?php if ($display == 'cat') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => 3, 'offset' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => 3, 'offset' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'specific') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'post__in' => $specific, 'posts_per_page' => 3, 'offset' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 3, 'offset' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <?php if (mom_post_image() != false) { ?> <div class="def-slider-item small-slider2" itemscope="" itemtype="http://schema.org/Article"> <a itemprop="url" href="<?php the_permalink(); ?> "><?php mom_post_image_full('catslider-thumb'); ?> </a> <?php if ($cap != 'no') { ?> <div class="def-slider-cap"> <div class="def-slider-title"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> </div> <?php if ($exc != false) { ?> <p class="def-slider-desc"> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } echo wp_html_excerpt(strip_shortcodes($excerpt), $exc); ?> ... </p> <?php } ?> </div> <?php } ?> </div> <?php } ?> <?php } } else { } wp_reset_postdata(); ?> </div><!-- slider2 wrap --> </section> <?php } elseif ($type == 'cat') { ?> <section class="section clearfix <?php echo $class; ?> feature_slider_<?php echo $id; ?> feature-cat-slider-wrap"> <div class="fc_nav"> <a class="fc_prev" href="#"><span class="enotype-icon-arrow-left7"></span></a> <a class="fc_next" href="#"><span class="enotype-icon-uniE6D8"></span></a> </div> <div class="cat-slider feature-cat-slider"> <div class="cat-slider-wrap" data-cat_timeout="<?php echo $timeout; ?> "> <?php $parent_posts = ''; if ($display == 'cat') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'specific') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'post__in' => $specific, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } $parent_posts[] = get_the_ID(); ?> <?php if (mom_post_image() != false) { ?> <div class="cat-slider-item" itemscope="" itemtype="http://schema.org/Article"> <?php $layout = mom_option('main_layout'); $site_width = mom_option('site_width'); $thumb_size = 'catslider1-thumb'; if (strpos($layout, 'both') === false) { $thumb_size = 'catslider-thumb'; if ($site_width == 'wide') { $thumb_size = 'catslider1-thumb'; } } if ($layout == 'fullwidth' && strpos(mom_option('main_layout'), 'both') !== false) { $thumb_size = 'catslider1-thumb'; } ?> <div class="feature-cs-cap"> <?php $category = get_the_category(); if ($category) { $cat_data = get_option("category_" . $category[0]->term_id); $cat_color = isset($cat_data['color']) ? $cat_data['color'] : ''; echo '<div class="cat-label" style="background:' . $cat_color . ';"><a href="' . get_category_link($category[0]->term_id) . '" title="' . sprintf(__("View all posts in %s", 'framework'), $category[0]->name) . '" ' . '>' . $category[0]->name . '</a></div>'; } ?> <h2 itemprop="name"><a href="<?php the_permalink(); ?> " itemprop="url"><?php the_title(); ?> </a></h2> <?php if ($exc != '') { ?> <p class="feature-cs-desc"> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } echo wp_html_excerpt(strip_shortcodes($excerpt), $exc); ?> ... </p> <?php } ?> </div> <a href="<?php the_permalink(); ?> "> <?php echo mom_post_image_full($thumb_size); ?> </a> </div> <?php } } } else { ?> <?php } ?> <?php wp_reset_postdata(); ?> </div> <div class="cat-slider-nav"> <ul> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => 'post__in', 'no_found_rows' => true, 'cache_results' => false, 'post__in' => $parent_posts)); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <?php if (mom_post_image() != false) { ?> <li itemscope="" itemtype="http://schema.org/Article"> <a href="<?php the_permalink(); ?> " itemprop="url"> <h2 itemprop="name"><?php short_title(47); ?> </h2> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php the_time('Y/m/d'); ?> </time> <div class="author-link"> <?php _e('by ', 'framework'); ?> <a itemprop="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " rel="author"><?php echo get_the_author(); ?> </a> </div> </div> </a> </li> <?php } ?> <?php } } else { ?> <?php } wp_reset_postdata(); ?> </ul> </div> </div> </section> <?php } else { ?> <!-- Default slider --> <section class="section <?php echo $class; ?> feature_slider_<?php echo $id; ?> "><!--def slider--> <div class="def-slider"> <div class="def-slider-wrap momizat-custom-slider" data-srtl="<?php echo $rtl; ?> " data-animate_out='<?php echo $animationout; ?> ' data-animate_in="<?php echo $animationin; ?> " data-autoplay="<?php echo $autoplay; ?> " data-timeout="<?php echo $timeout; ?> " data-bullets_event="<?php echo $bullets_event; ?> "> <?php $count = 1; if ($display == 'cat') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'specific') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'post__in' => $specific, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <?php if (mom_post_image() != false) { ?> <div class="def-slider-item" data-dot="<?php echo $count; ?> " itemscope="" itemtype="http://schema.org/Article"> <a itemprop="url" href="<?php the_permalink(); ?> "> <?php $thumbsize = 'slider-thumb'; if (mom_option('site_width') == 'wide') { $classes = get_body_class(); if (in_array('right-sidebar', $classes) || in_array('left-sidebar', $classes)) { $thumbsize = 'big-thumb-hd'; } } mom_post_image_full($thumbsize); ?> </a> <?php if ($cap != 'no') { ?> <div class="def-slider-cap"> <div class="def-slider-title"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> </div> <?php if ($exc != false) { ?> <p class="def-slider-desc"> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } echo wp_html_excerpt(strip_shortcodes($excerpt), $exc, '...'); ?> </p> <?php } ?> </div> <?php } ?> </div> <?php } ?> <?php $count++; } } else { } wp_reset_postdata(); ?> </div> </div> </section><!--def slider--> <?php } ?> <!-- End Slider type --> <?php $output = ob_get_contents(); ob_end_clean(); set_transient('mom_feature_sliders' . $id . $type . $display . $cats . $tag . $class . $orderby, $output, 60 * 60 * 24); } return $output; }
function widget($args, $instance) { extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $orderby = $instance['orderby']; $count = $instance['count']; $display = isset($instance['display']) ? $instance['display'] : array(); $cats = isset($instance['cats']) ? $instance['cats'] : array(); $output = get_transient($this->id); if ($orderby == 'Random') { $output = false; } if ($output == false) { ob_start(); /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ($title) { echo $before_title . $title . $after_title; } global $unique_posts; global $do_unique_posts; ?> <div class="news-pics-widget"> <ul class="npwidget clearfix"> <?php if ($orderby == 'Popular') { ?> <?php if ($display == 'cats') { $catsi = implode(',', $cats); ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $catsi, 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'orderby' => 'comment_count', 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); ?> <?php } else { ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'orderby' => 'comment_count', 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); ?> <?php } ?> <?php } elseif ($orderby == 'Random') { ?> <?php if ($display == 'cats') { $catsi = implode(',', $cats); ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $catsi, 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'orderby' => 'rand', 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); ?> <?php } else { ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'orderby' => 'comment_count', 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); ?> <?php } ?> <?php } elseif ($orderby == 'Recent') { ?> <?php if ($display == 'cats') { $catsi = implode(',', $cats); ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $catsi, 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); ?> <?php } else { ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); ?> <?php } ?> <?php } ?> <?php update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <?php if (mom_post_image() != false) { ?> <li class="simptip-position-top simptip-movable half-arrow simptip-multiline" data-tooltip="<?php the_title(); ?> " itemscope="" itemtype="http://schema.org/Article"> <figure class="post-thumbnail"><a itemprop="url" href="<?php the_permalink(); ?> " rel="bookmark"> <?php mom_post_image_full('postpicwid-thumb'); ?> </a></figure> </li> <?php } ?> <?php } ?> <?php } else { ?> <!-- Else in here --> <?php } ?> <?php wp_reset_postdata(); ?> </ul> </div> <?php /* After widget (defined by themes). */ echo $after_widget; $output = ob_get_contents(); ob_end_clean(); set_transient($this->id, $output, 60 * 60 * 24); } echo $output; }
function mom_category_content($cols = 2) { $cols = 'grid-col-' . $cols; $cat_data = get_option("category_" . get_query_var('cat')); $cat_layout = isset($cat_data['layout']) ? $cat_data['layout'] : ''; $cat_layout_style = isset($cat_data['layout_style']) ? $cat_data['layout_style'] : ''; $dateformat = mom_option('date_format'); $ad_id = mom_option('cat_ad_id'); $ad_count = mom_option('cat_ad_count'); $ad_repeat = mom_option('cat_ad_repeat'); $post_head = ''; $post_meta_hp = mom_option('post_meta_hp'); if ($post_meta_hp == 1) { $post_head = mom_option('post_head'); $post_head_author = mom_option('post_head_author'); $post_head_date = mom_option('post_head_date'); $post_head_cat = mom_option('post_head_cat'); $post_head_commetns = mom_option('post_head_commetns'); $post_head_views = mom_option('post_head_views'); } else { $post_head = 1; $post_head_author = 1; $post_head_date = 1; $post_head_cat = 1; $post_head_commetns = 1; $post_head_views = 1; } if (mom_option('cat_posts_layout') == 'blog' || $cat_layout == 'blog') { $style = ''; if (mom_option('cat_posts_layout_style') == 'large' || $cat_layout_style == 'large') { $style = 'large'; } else { $style = ''; } $nexcerpt = ''; $class = ''; ?> <div class="blog_posts"> <?php $post_count = 1; if (have_posts()) { while (have_posts()) { the_post(); ?> <?php mom_blog_post($style, $nexcerpt, $class); if ($ad_id != '') { if ($ad_repeat == 1) { if ($post_count % $ad_count == 0) { echo do_shortcode('[ad id="' . $ad_id . '"]'); } } else { if ($post_count == $ad_count) { echo do_shortcode('[ad id="' . $ad_id . '"]'); } } } $post_count++; ?> <?php } } else { ?> <!-- Else in here --> <?php } ?> <?php mom_pagination(); ?> </div> <?php } else { ?> <div class="site-content page-wrap"> <?php if (mom_option('cat_swi')) { ?> <div class="f-tabbed-head"> <ul class="f-tabbed-sort cat-sort"> <li class="grid active"><a href="#"><span class="brankic-icon-grid"></span><?php _e(' Grid', 'framework'); ?> </a></li> <li class="list"><a href="#"><span class="brankic-icon-list2"></span><?php _e(' List', 'framework'); ?> </a></li> </ul> </div> <?php } ?> <?php $catswi = mom_option('cat_swi_def'); $swiclass = 'cat-grid ' . $cols; if ($catswi == 'list') { $swiclass = 'cat-list'; } $srclass = ''; if (mom_option('cat_swi') != true) { $srclass = ' no-head'; } ?> <div class="cat-body<?php echo $srclass; ?> "> <ul class="nb1 <?php echo $swiclass; ?> clearfix"> <?php $post_count = 1; if (have_posts()) { while (have_posts()) { the_post(); ?> <li <?php post_class(); ?> itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name" class="cat-list-title"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($post_head != 0) { ?> <div class="cat-list-meta entry-meta"> <?php if ($post_head_author != 0) { ?> <div class="author-link"> <?php _e('Posted by', 'framework'); ?> <a itemprop="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " rel="author"><?php echo get_the_author(); ?> </a> </div> <?php } ?> <?php if ($post_head_date != 0) { ?> <span>|</span><time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php _e('Date: ', 'framework'); the_time($dateformat); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <span>|</span><a href="<?php the_permalink(); ?> "> <?php comments_number(__('0 comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> <?php if ($post_head_views != 0) { ?> <div class="post-views"> <span>|</span><?php echo getPostViews(get_the_ID()); ?> </div> <?php } ?> </div> <?php } ?> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <h2 itemprop="name" class="cat-grid-title"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content cat-grid-meta"> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } echo wp_html_excerpt(strip_shortcodes($excerpt), 105); ?> ... </p> </div> <?php if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <div class="entry-content cat-list-meta"> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } echo wp_html_excerpt(strip_shortcodes($excerpt), 200); ?> ... </p> </div> <?php if ($post_head != 0) { ?> <div class="cat-grid-meta entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php the_time($dateformat); ?> </time> <?php } ?> <?php if ($post_head_author != 0) { ?> <div class="author-link"> |<?php _e(' by ', 'framework'); ?> <a itemprop="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " rel="author"><?php echo get_the_author(); ?> </a> </div> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> |<a href="<?php the_permalink(); ?> "> <?php comments_number(__('0 comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> <?php if (is_rtl()) { ?> <a class="read-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'framework'); ?> <i class="fa-icon-angle-double-left"></i></a> <?php } else { ?> <a class="read-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'framework'); ?> <i class="fa-icon-angle-double-right"></i></a> <?php } ?> </div> </li> <?php if ($ad_id != '') { if ($ad_repeat == 1) { if ($post_count % $ad_count == 0) { echo '<li>'; echo do_shortcode('[ad id="' . $ad_id . '"]'); echo '</li>'; } } else { if ($post_count == $ad_count) { echo '<li>'; echo do_shortcode('[ad id="' . $ad_id . '"]'); echo '</li>'; } } } $post_count++; } } else { ?> <!-- Else in here --> <?php } ?> </ul> <?php mom_pagination(); ?> </div> </div> <?php } }
function widget($args, $instance) { extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $orderby = $instance['orderby']; $count = $instance['count']; $display = $instance['display']; $cats = isset($instance['cats']) ? $instance['cats'] : array(); $relatedby = mom_option('related_type'); if (is_single()) { if ($relatedby == 'tag') { $by = wp_get_post_tags(get_the_ID()); } else { $by = get_the_category(get_the_ID()); } if ($by) { /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ($title) { echo $before_title . $title . $after_title; } $dateformat = mom_option('date_format'); $post_meta_hp = mom_option('post_meta_hp'); if ($post_meta_hp == 1) { $post_head = mom_option('post_head'); $post_head_author = mom_option('post_head_author'); $post_head_date = mom_option('post_head_date'); $post_head_cat = mom_option('post_head_cat'); $post_head_commetns = mom_option('post_head_commetns'); $post_head_views = mom_option('post_head_views'); } else { $post_head = 1; $post_head_author = 1; $post_head_date = 1; $post_head_cat = 1; $post_head_commetns = 1; $post_head_views = 1; } ?> <ul class="post-list"> <?php if ($by && $relatedby == 'tag') { $tag_ids = array(); foreach ($by as $individual_tag) { $tag_ids[] = $individual_tag->term_id; } $args = array('post_type' => 'post', 'post_status' => 'publish', 'tag__in' => $tag_ids, 'post__not_in' => array(get_the_ID()), 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'no_found_rows' => true, 'cache_results' => false); } if ($by && $relatedby != 'tag') { $cat_ids = array(); foreach ($by as $individual_cat) { $cat_ids[] = $individual_cat->cat_ID; } $args = array('post_type' => 'post', 'post_status' => 'publish', 'category__in' => $cat_ids, 'post__not_in' => array(get_the_ID()), 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'no_found_rows' => true, 'cache_results' => false); } $query = new WP_Query($args); update_post_thumbnail_cache($query); ?> <?php if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <li itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a itemprop="url" href="<?php the_permalink(); ?> " rel="bookmark"> <?php mom_post_image_full('postlist-thumb'); ?> </a></figure> <?php } ?> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h2> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php the_time($dateformat); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php the_permalink(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> <a href="<?php the_permalink(); ?> " class="read-more-link"><?php _e('Read more...', 'framework'); ?> </a> </li> <?php } ?> <?php } else { ?> <!-- Else in here --> <?php } ?> <?php wp_reset_postdata(); ?> </ul> <?php /* After widget (defined by themes). */ echo $after_widget; } // if by } // is single }
function mom_blog_post($style = 1, $nexcerpt, $class) { global $post; $post_meta_hp = mom_option('post_meta_hp'); if ($post_meta_hp == 1) { $post_head = mom_option('post_head'); $post_head_author = mom_option('post_head_author'); $post_head_date = mom_option('post_head_date'); $post_head_cat = mom_option('post_head_cat'); $post_head_commetns = mom_option('post_head_commetns'); $post_head_views = mom_option('post_head_views'); } else { $post_head = 1; $post_head_author = 1; $post_head_date = 1; $post_head_cat = 1; $post_head_commetns = 1; $post_head_views = 1; } if ($style == 'large') { ?> <article <?php post_class('blog-post-big nb1 ' . $class); ?> itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"> <a href="<?php the_permalink(); ?> "> <?php $thumbsize = 'blogb-thumb'; if (mom_option('site_width') == 'wide') { $thumbsize = 'big-thumb-hd'; } mom_post_image_full($thumbsize); ?> <span class="post-format-icon"></span> </a> </figure> <?php } ?> <h2 itemprop="name"> <a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h2> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_author != 0) { ?> <div class="author-link"> <?php _e('Posted by ', 'framework'); ?> <a itemprop="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " rel="author"><?php echo get_the_author(); ?> </a> </div> <?php } ?> <?php if ($post_head_date != 0) { ?> <span>|</span><time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_cat != 0) { ?> <div class="cat-link"> <span>|</span><?php _e('in :', 'framework'); ?> <?php the_category(', '); ?> </div> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <span>|</span><a href="<?php the_permalink(); ?> "> <?php comments_number(__('0 comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> <?php if ($post_head_views != 0) { ?> <div class="post-views"> <span>|</span><?php echo getPostViews(get_the_ID()); ?> </div> <?php } ?> </div> <?php } ?> <div class="entry-content"> <?php $excerpt = get_the_excerpt(); if ($excerpt == false) { $excerpt = get_the_content(); } if ($nexcerpt != '') { echo wp_html_excerpt(strip_shortcodes($excerpt), $nexcerpt, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), 304, '...'); } ?> </div> <?php if (is_rtl()) { ?> <a class="read-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'framework'); ?> <i class="fa-icon-angle-double-left"></i></a> <?php } else { ?> <a class="read-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'framework'); ?> <i class="fa-icon-angle-double-right"></i></a> <?php } ?> </article> <?php } elseif ($style == 'grid') { $dateformat = mom_option('date_format'); ?> <li <?php post_class(); ?> itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name" class="cat-list-title"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($post_head != 0) { ?> <div class="cat-list-meta entry-meta"> <?php if ($post_head_author != 0) { ?> <div class="author-link"> <?php _e('Posted by', 'framework'); ?> <a itemprop="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " rel="author"><?php echo get_the_author(); ?> </a> </div> <?php } ?> <?php if ($post_head_date != 0) { ?> <span>|</span><time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php _e('Date: ', 'framework'); the_time($dateformat); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <span>|</span><a href="<?php the_permalink(); ?> "> <?php comments_number(__('0 comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> <?php if ($post_head_views != 0) { ?> <div class="post-views"> <span>|</span><?php echo getPostViews(get_the_ID()); ?> </div> <?php } ?> </div> <?php } ?> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <h2 itemprop="name" class="cat-grid-title"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content cat-grid-meta"> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } echo wp_html_excerpt(strip_shortcodes($excerpt), 105, '...'); ?> ... </p> </div> <?php if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <div class="entry-content cat-list-meta"> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } echo wp_html_excerpt(strip_shortcodes($excerpt), 200, '...'); ?> ... </p> </div> <?php if ($post_head != 0) { ?> <div class="cat-grid-meta entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php the_time($dateformat); ?> </time> <?php } ?> <?php if ($post_head_author != 0) { ?> <div class="author-link"> |<?php _e(' by ', 'framework'); ?> <a itemprop="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " rel="author"><?php echo get_the_author(); ?> </a> </div> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> |<a href="<?php the_permalink(); ?> "> <?php comments_number(__('0 comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> <?php if (is_rtl()) { ?> <a class="read-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'framework'); ?> <i class="fa-icon-angle-double-left"></i></a> <?php } else { ?> <a class="read-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'framework'); ?> <i class="fa-icon-angle-double-right"></i></a> <?php } ?> </div> </li> <?php } else { ?> <article <?php post_class('blog-post nb1 ' . $class); ?> itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name"> <a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h2> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_author != 0) { ?> <div class="author-link"> <?php _e('Posted by ', 'framework'); ?> <a itemprop="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " rel="author"><?php echo get_the_author(); ?> </a> </div> <?php } ?> <?php if ($post_head_date != 0) { ?> <span>|</span><time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_cat != 0) { ?> <div class="cat-link"> <span>|</span><?php _e('in :', 'framework'); ?> <?php the_category(', '); ?> </div> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <span>|</span><a href="<?php the_permalink(); ?> "> <?php comments_number(__('0 comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> <?php if ($post_head_views != 0) { ?> <div class="post-views"> <span>|</span><?php echo getPostViews(get_the_ID()); ?> </div> <?php } ?> </div> <?php } ?> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"> <a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('blog-thumb'); ?> <span class="post-format-icon"></span> </a> </figure> <?php } ?> <div class="entry-content"> <?php $excerpt = get_the_excerpt(); if ($excerpt == false) { $excerpt = get_the_content(); } if ($nexcerpt != '') { echo wp_html_excerpt(strip_shortcodes($excerpt), $nexcerpt, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), 170, '...'); } ?> </div> <?php if (is_rtl()) { ?> <a class="read-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'framework'); ?> <i class="fa-icon-angle-double-left"></i></a> <?php } else { ?> <a class="read-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'framework'); ?> <i class="fa-icon-angle-double-right"></i></a> <?php } ?> </article> <?php } }
} } ?> <li <?php post_class(); ?> itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('search-grid'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <?php if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class;
function mom_nb_show_more() { // stay away from bad guys $nonce = $_POST['nonce']; $nbs = $_POST['nbs']; $number_of_posts = $_POST['number_of_posts']; $orderby = $_POST['orderby']; $offset = $_POST['offset']; $offset_second = $_POST['offset_second']; $offset_all = $_POST['offset_all']; $cat = $_POST['cat']; if (!wp_verify_nonce($nonce, 'ajax-nonce')) { die('Nope!'); } $hpmeta = mom_option('post_meta_hp'); if ($nbs == 'nb1') { $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <li <?php post_class(); ?> itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php the_permalink(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> </div> <?php } ?> </div> </li> <?php } } else { } wp_reset_postdata(); } elseif ($nbs == 'nb2') { $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => 1, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <div <?php post_class('first-item'); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> </div> <?php } ?> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 145, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> </div> </div> <?php } } else { } wp_reset_postdata(); $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset_all, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { echo '<ul>'; while ($query->have_posts()) { $query->the_post(); ?> <li role="article" itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php mom_date_format(); ?> </time> <div class="comments-link"> <a href="<?php the_permalink(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> </div> <?php } ?> </li> <?php } echo '</ul>'; } else { } wp_reset_postdata(); } elseif ($nbs == 'nb3') { $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => 2, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <div <?php post_class('first-item'); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> </div> <?php } ?> </div> </div> <?php } } else { } wp_reset_postdata(); $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset_all, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { echo '<ul>'; while ($query->have_posts()) { $query->the_post(); ?> <li role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb3-thumb'); ?> </a></figure> <?php } ?> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php the_permalink(); ?> "><?php comments_number('(0)', '(1)', '(%)'); ?> </a> </div> </div> <?php } ?> </li> <?php } echo '</ul>'; } else { } wp_reset_postdata(); } elseif ($nbs == 'nb4') { $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => 1, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <div <?php post_class('first-item'); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 110, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> </div> <?php } ?> </div> </div> <?php } } else { } wp_reset_postdata(); $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset_all, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { echo '<ul>'; while ($query->have_posts()) { $query->the_post(); ?> <li role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb3-thumb'); ?> </a></figure> <?php } ?> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <!-- <div class="comments-link"> <a href="<?php the_permalink(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> --> </div> <?php } ?> </li> <?php } echo '</ul>'; } else { } wp_reset_postdata(); } elseif ($nbs == 'nb5') { $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => 1, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <div <?php post_class('first-item'); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb5-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 180, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> </div> <?php } ?> </div> </div> <?php } } else { } wp_reset_postdata(); $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset_all, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { echo '<ul>'; while ($query->have_posts()) { $query->the_post(); ?> <li role="article" itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php mom_date_format(); ?> </time> <div class="comments-link"> <a href="#"><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> </div> <?php } ?> </li> <?php } echo '</ul>'; } else { } wp_reset_postdata(); } elseif ($nbs == 'nb6') { $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish')); if ($query->have_posts()) { echo '<ul>'; while ($query->have_posts()) { $query->the_post(); ?> <li <?php post_class(); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb5-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 120, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($hpmeta == 1) { ?> <div class="entry-meta"> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="#"><?php comments_number('(0)', '(1)', '(%)'); ?> </a> </div> </div> <?php } ?> </div> </li> <?php } echo '</ul>'; } else { } wp_reset_postdata(); } exit; }
function widget($args, $instance) { extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $orderby = $instance['orderby']; $count = $instance['count']; $display = $instance['display']; $animation = isset($instance['animation']) ? esc_attr($instance['animation']) : ''; $animationin = isset($instance['animationin']) ? esc_attr($instance['animationin']) : ''; $animationout = isset($instance['animationout']) ? esc_attr($instance['animationout']) : ''; $autoplay = isset($instance['autoplay']) ? esc_attr($instance['autoplay']) : ''; $timeout = isset($instance['timeout']) ? esc_attr($instance['timeout']) : ''; $cats = isset($instance['cats']) ? $instance['cats'] : array(); $output = get_transient($this->id); if ($orderby == 'Random') { $output = false; } if ($output == false) { ob_start(); /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ($title) { echo $before_title . $title . $after_title; } global $post; $rndn = rand(0, 100); if ($animation == 'fade') { $animationout = 'fadeOut'; $animationin = ''; } elseif ($animation == 'slide') { $animationout = ''; $animationin = ''; } elseif ($animation == 'flip') { $animationout = 'slideOutDown'; $animationin = 'flipInX'; } if ($autoplay == 'no') { $autoplay = 'false'; } else { $autoplay = 'true'; } ?> <div class="slider-widget"> <script> //widget slider jQuery(document).ready(function($) { var rtl = false; <?php if (is_rtl()) { ?> rtl = true; <?php } ?> $('.wmcs-<?php echo $rndn; ?> ').owlCarousel({ animateOut: '<?php echo $animationout; ?> ', animateIn: '<?php echo $animationin; ?> ', autoplay:<?php echo $autoplay; ?> , <?php if ($timeout != '') { ?> autoplayTimeout:<?php echo $timeout; ?> , <?php } ?> autoplayHoverPause:false, rtl: rtl, items:1, nav: true, navText: ['<span class="enotype-icon-arrow-left7"></span>', '<span class="enotype-icon-uniE6D8"></span>' ], smartSpeed:1000, }); }); </script> <div class="slider-widget-wrap momizat-custom-slider wmcs-<?php echo $rndn; ?> "> <?php if ($orderby == 'Popular') { ?> <?php if ($display == 'cats') { $catsi = implode(',', $cats); ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $catsi, 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'orderby' => 'comment_count', 'no_found_rows' => true, 'cache_results' => false)); ?> <?php } else { ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'orderby' => 'comment_count', 'no_found_rows' => true, 'cache_results' => false)); ?> <?php } ?> <?php } elseif ($orderby == 'Random') { ?> <?php if ($display == 'cats') { $catsi = implode(',', $cats); ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $catsi, 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'orderby' => 'rand', 'no_found_rows' => true, 'cache_results' => false)); ?> <?php } else { ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'orderby' => 'comment_count', 'no_found_rows' => true, 'cache_results' => false)); ?> <?php } ?> <?php } elseif ($orderby == 'Recent') { ?> <?php if ($display == 'cats') { $catsi = implode(',', $cats); ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $catsi, 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'no_found_rows' => true, 'cache_results' => false)); ?> <?php } else { ?> <?php $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'no_found_rows' => true, 'cache_results' => false)); ?> <?php } ?> <?php } ?> <?php if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <?php if (mom_post_image() != false) { ?> <div class="slider-widget-item" itemscope="" itemtype="http://schema.org/Article"> <figure class="post-thumbnail"> <a itemprop="url" href="<?php the_permalink(); ?> " rel="bookmark"> <?php mom_post_image_full('sliderwidget-thumb'); ?> </a> </figure> <div class="slider-widget-title"> <h2 itemprop="name"> <a itemprop="url" href="<?php the_permalink(); ?> "> <?php the_title(); ?> </a> </h2> </div> </div> <?php } ?> <?php } ?> <?php } else { ?> <!-- Else in here --> <?php } ?> <?php wp_reset_postdata(); ?> </div> </div> <?php /* After widget (defined by themes). */ echo $after_widget; $output = ob_get_contents(); ob_end_clean(); set_transient($this->id, $output, 60 * 60 * 24); } echo $output; }
function mom_ajax_media_tab() { // stay away from bad guys $nonce = $_POST['nonce']; if (!wp_verify_nonce($nonce, 'ajax-nonce')) { die('Nope!'); } $type = $_POST['type']; $order = isset($_POST['order']) ? $_POST['order'] : ''; if ($type == 'all') { $type = array('post-format-audio', 'post-format-video', 'post-format-gallery'); } else { $type = array('post-format-' . $type); } if ($order == 'popular') { $order = 'comment_count'; } else { $order = 'date'; } ?> <ul class="media-items-list clearfix"> <?php $args = array('post_type' => 'post', 'posts_per_page' => -1, 'orderby' => $order, 'post_status' => 'publish', 'tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => $type, 'operator' => 'IN'))); $query = new WP_Query($args); $i = 0; if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); global $posts_st; $extra = get_post_meta(get_the_ID(), $posts_st->get_the_id(), TRUE); if (isset($extra['video_type'])) { $video_type = $extra['video_type']; } if (isset($extra['video_id'])) { $video_id = $extra['video_id']; } if (isset($extra['html5_mp4_url'])) { $html5_mp4 = $extra['html5_mp4_url']; } if (isset($extra['html5_duration'])) { $html5_duration = $extra['html5_duration']; } else { $html5_duration = '00:00'; } if (isset($extra['slides'])) { $slides = $extra['slides']; } else { $slides = ''; } $post_format = get_post_format(); $num_of_slides = $post_format == 'gallery' ? count($slides) : ''; if ($i < 2) { ?> <li <?php post_class('media-item featured'); ?> > <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"> <a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('media1-thumb'); ?> </a> <div class="media-data"> <div class="media-format"></div> <?php if ($post_format == 'video') { if ($video_type == 'youtube') { ?> <div class="video-time"> <?php echo mom_youtube_duration($video_id); ?> </div> <?php } elseif ($video_type == 'vimeo') { ?> <div class="video-time"> <?php echo mom_vimeo_duration($video_id); ?> </div> <?php } else { ?> <div class="video-time"> <?php echo $html5_duration; ?> </div> <?php } } elseif ($post_format == 'gallery') { ?> <div class="video-time"><?php echo $num_of_slides; ?> </div> <?php } else { ?> <div class="video-time"> <?php echo $html5_duration; ?> </div> <?php } ?> </div> </figure> <?php } ?> <h2><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h2> <div class="entry-meta"> <time datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php mom_date_format(); ?> </time> <div class="cat-link"> <?php the_category(', '); ?> </div> </div> </li> <?php } else { ?> <li <?php post_class('media-item m-items'); ?> id="m-items"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"> <a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('media-thumb'); ?> </a> <div class="media-data"> <div class="media-format"></div> <?php if ($post_format == 'video') { if ($video_type == 'youtube') { ?> <div class="video-time"> <?php echo mom_youtube_duration($video_id); ?> </div> <?php } elseif ($video_type == 'vimeo') { ?> <div class="video-time"> <?php echo mom_vimeo_duration($video_id); ?> </div> <?php } else { ?> <div class="video-time"> <?php echo $html5_duration; ?> </div> <?php } } elseif ($post_format == 'gallery') { ?> <div class="video-time"><?php echo $num_of_slides; ?> </div> <?php } else { ?> <div class="video-time"> <?php echo $html5_duration; ?> </div> <?php } ?> </div> </figure> <?php } ?> <h2><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h2> <div class="entry-meta"> <time datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php mom_date_format(); ?> </time> <div class="cat-link"> <?php the_category(', '); ?> </div> </div> </li> <?php } $i++; } } else { } wp_reset_postdata(); ?> </ul> <?php exit; }
function mom_news_pics($atts, $content = null) { global $unique_posts; global $do_unique_posts; extract(shortcode_atts(array('title' => 'Latest Posts', 'display' => '', 'cat' => '', 'tag' => '', 'orderby' => '', 'count' => '8', 'class' => ''), $atts)); static $id = 75; $id++; $output = get_transient('mom_news_pix_' . $id); if ($output == false) { ob_start(); global $wpdb; $tag_ID = $wpdb->get_var("SELECT * FROM " . $wpdb->terms . " WHERE 'name' = '" . $tag . "'"); if ($display == 'category') { $np_title = get_cat_name($cat); $np_link = get_category_link($cat); } elseif ($display == 'tag') { $np_title = $tag; $np_link = get_tag_link($tag_ID); } else { $np_title = $title; $np_link = '#'; } ?> <section class="section <?php echo $class; ?> nip-box <?php if ($display == 'category') { ?> cat_<?php echo $cat; } ?> "><!--news pics--> <header class="block-title"> <h2><?php echo $np_title; ?> </h2> </header> <div class="nip clearfix"> <?php if ($display == 'category') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cat, 'posts_per_page' => 1, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => 1, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 1, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <?php if (mom_post_image() != false) { ?> <div class="first-item" itemscope="" itemtype="http://schema.org/Article"> <figure class="post-thumbnail"><a class="simptip-position-top simptip-movable half-arrow simptip-multiline" itemprop="url" href="<?php the_permalink(); ?> " data-tooltip="<?php the_title(); ?> "> <?php mom_post_image_full('npic-thumb'); ?> </a></figure> </div> <?php } ?> <?php } } else { } wp_reset_postdata(); ?> <ul> <?php if ($display == 'category') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cat, 'posts_per_page' => $count, 'offset' => 1, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => $count, 'offset' => 1, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $count, 'offset' => 1, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <?php if (mom_post_image() != false) { ?> <li class="simptip-position-top simptip-movable half-arrow simptip-multiline" data-tooltip="<?php the_title(); ?> " itemscope="" itemtype="http://schema.org/Article"> <figure class="post-thumbnail"><a itemprop="url" href="<?php the_permalink(); ?> "> <?php mom_post_image_full('np-thumb'); ?> </a></figure> </li> <?php } ?> <?php } } else { } wp_reset_postdata(); ?> </ul> </div> </section><!--news pics--> <?php $output = ob_get_contents(); ob_end_clean(); set_transient('mom_news_pix_' . $id, $output, 60 * 60 * 24); } return $output; }
$query = new WP_Query(array('cat' => $categoryid, 'posts_per_page' => 4, 'offset' => 2, 'orderby' => 'comment_count', 'no_found_rows' => true, 'cache_results' => false, 'ignore_sticky_posts' => 1)); update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <li> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('postlist-thumb'); ?> </a></figure> <?php } ?> <div class="f-p-title"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <span class="post-format-icon"></span> </div>
} else { ?> <li <?php post_class('media-item m-items'); ?> id="m-items"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"> <a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('media-thumb'); ?> </a> <div class="media-data"> <div class="media-format"></div> <?php if ($post_format == 'video') { ?> <?php if ($video_type == 'youtube') { ?> <?php if (mom_youtube_duration($video_id) != false) { ?> <div class="video-time"> <?php
function mom_scrollers($atts, $content = null) { global $unique_posts; global $do_unique_posts; extract(shortcode_atts(array('style' => 'sc1', 'title' => '', 'title_size' => '17', 'sub_title' => '', 'display' => 'latest', 'cats' => '', 'tags' => '', 'orderby' => '', 'number_of_posts' => '5', 'auto_play' => '3000', 'speed' => '300', 'items' => '4'), $atts)); static $id = 75; $id++; if ($cats == 'Select a Category') { $cats = ''; } if ($tags == 'Select a Tag') { $tags = ''; } $output = get_transient('mom_scroller_' . $id . $style . $display . $cats . $tags . $items . $orderby); if ($orderby == 'rand') { $output = false; } if ($output == false) { ob_start(); //wp_enqueue_script('owl'); $dateformat = mom_option('date_format'); $post_meta_hp = mom_option('post_meta_hp'); if ($post_meta_hp == 1) { $post_head = mom_option('post_head'); $post_head_author = mom_option('post_head_author'); $post_head_date = mom_option('post_head_date'); $post_head_cat = mom_option('post_head_cat'); $post_head_commetns = mom_option('post_head_commetns'); $post_head_views = mom_option('post_head_views'); } else { $post_head = 1; $post_head_author = 1; $post_head_date = 1; $post_head_cat = 1; $post_head_commetns = 1; $post_head_views = 1; } $authormeta = mom_option('post_head_author'); $rndn = rand(0, 100); global $wpdb; $tag_ID = $wpdb->get_var("SELECT * FROM " . $wpdb->terms . " WHERE 'name' = '" . $tags . "'"); $nb_link = ''; if ($display == 'cats') { if ($title == '') { $nb_title = get_cat_name($cats); $nb_link = get_category_link($cats); } else { $nb_title = $title; } } elseif ($display == 'tags') { if ($title == '') { $nb_title = $tags; $nb_link = get_tag_link($tag_ID); } else { $nb_title = $title; } } else { $nb_title = $title; $nb_link = ''; } if ($auto_play != '') { $autoplay = 'true'; } else { $autoplay = 'false'; } if (is_rtl()) { $rtl = 'true'; } else { $rtl = 'false'; } $link_start = ''; $link_end = ''; if ($nb_link != '') { $link_start = '<a href="' . $nb_link . '">'; $link_end = '</a>'; } ?> <?php if ($style == 'sc1') { ?> <section class="section scroller-section scroller-<?php echo $id; ?> "> <header class="section-header"> <?php if ($title_size == '17') { ?> <h2 class="section-title"><?php echo $link_start . $nb_title . $link_end; ?> </h2> <?php } else { ?> <h1 class="section-title2"><?php echo $link_start . $nb_title . $link_end; ?> </h1> <?php } ?> <?php if ($sub_title != '') { ?> <span class="mom-sub-title"><?php echo $sub_title; ?> </span><?php } ?> </header> <div class="scroller"> <div class="scroller-wrap scroller-wrap-1" data-sc-auto="<?php echo $autoplay; ?> " data-sc-autotime="<?php echo $auto_play; ?> " data-sc-speed="<?php echo $speed; ?> " data-sc-rtl="<?php echo $rtl; ?> " data-items="<?php echo $items; ?> "> <?php if ($display == 'cats') { $squery = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tags') { $squery = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tags, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $squery = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($squery); if ($squery->have_posts()) { while ($squery->have_posts()) { $squery->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } $post_url = get_post_meta(get_the_ID(), 'mom_post_custom_link', true); if ($post_url == '') { $post_url = get_permalink(); } ?> <?php if (mom_post_image() != false) { ?> <div class="scroller-item" itemscope="" itemtype="http://schema.org/Article"> <a itemprop="url" href="<?php echo $post_url; ?> "> <figure class="post-thumbnail"> <?php mom_post_image_full('scroller-thumb'); ?> </figure> <h2 itemprop="name"><?php the_title(); ?> </h2> </a> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_author == 1) { ?> <div class="author-link"> <i class="momizat-icon-user3"></i><a itemprop="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " rel="author"><?php echo get_the_author(); ?> </a> </div> <?php } ?> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php the_time('Y/m/d'); ?> </time> <?php } ?> <?php if ($post_head_cat != 0) { ?> <div class="cat-link"> <i class="momizat-icon-folder-open"></i><?php $category = get_the_category(); echo '<a class="category" href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '</a>'; ?> </div> <?php } ?> </div> <?php } ?> </div> <?php } ?> <?php } } else { } wp_reset_postdata(); ?> </div> </div> </section> <?php } else { ?> <section class="section scroller-section scroller-<?php echo $id; ?> "> <header class="section-header"> <?php if ($title_size == '17') { ?> <h2 class="section-title"><?php echo $link_start . $nb_title . $link_end; ?> </h2> <?php } else { ?> <h1 class="section-title2"><?php echo $link_start . $nb_title . $link_end; ?> </h1> <?php } ?> <?php if ($sub_title != '') { ?> <span class="mom-sub-title"><?php echo $sub_title; ?> </span><?php } ?> </header> <div class="scroller2"> <div class="scroller2-wrap scroller-wrap-2" data-sc2-auto="<?php echo $autoplay; ?> " data-sc2-autotime="<?php echo $auto_play; ?> " data-sc2-speed="<?php echo $speed; ?> " data-sc2-rtl="<?php echo $rtl; ?> " data-items="<?php echo $items; ?> "> <?php if ($display == 'cats') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tags') { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tags, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } $post_url = get_post_meta(get_the_ID(), 'mom_post_custom_link', true); if ($post_url == '') { $post_url = get_permalink(); } ?> <div class="scroller-item" itemscope="" itemtype="http://schema.org/Article"> <a itemprop="url" href="<?php echo $post_url; ?> "> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"> <?php mom_post_image_full('scroller-thumb'); ?> </figure> <?php } ?> <h2 itemprop="name"><?php the_title(); ?> </h2> </a> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_author == 1) { ?> <div class="author-link"> <i class="momizat-icon-user3"></i><a itemprop="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " rel="author"><?php echo get_the_author(); ?> </a> </div> <?php } ?> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php the_time('Y/m/d'); ?> </time> <?php } ?> <?php if ($post_head_cat != 0) { ?> <div class="cat-link"> <i class="momizat-icon-folder-open"></i><?php $category = get_the_category(); echo '<a class="category" href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '</a>'; ?> </div> <?php } ?> </div> <?php } ?> </div> <?php } } else { } wp_reset_postdata(); ?> </div> </div> </section> <?php } ?> <?php $output = ob_get_contents(); ob_end_clean(); set_transient('mom_scroller_' . $id . $style . $display . $cats . $tags . $items . $orderby, $output, 60 * 60 * 24); } return $output; }
<?php } ?> </div> <?php } ?> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <h2 itemprop="name" class="cat-grid-title"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content cat-grid-meta"> <p>
$query = new WP_Query($args); update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <li itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('related-thumb'); ?> </a></figure> <?php } ?> <h2 itemprop="name"><a href="<?php the_permalink(); ?> " itemprop="url" rel="bookmark"><?php the_title(); ?> </a></h2> <div class="entry-meta"> <time datetime="<?php the_time('c');
function widget($args, $instance) { extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $orderby = $instance['orderby']; $count = $instance['count']; $display = $instance['display']; $cats = isset($instance['cats']) ? $instance['cats'] : array(); $tags = isset($instance['tags']) ? $instance['tags'] : array(); $output = get_transient($this->id); if ($output == false) { ob_start(); /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ($title) { echo $before_title . $title . $after_title; } ?> <ul class="post-list"> <?php if ($orderby == 'top') { if ($display == 'cats') { $catsi = implode(',', $cats); $query = new WP_Query(array('orderby' => 'meta_value_num', 'meta_key' => '_mom_review-final-score', 'meta_value' => 0, 'meta_compare' => '!=', "ignore_sticky_posts" => 1, 'showposts' => $count, 'cat' => $catsi, 'no_found_rows' => true, 'cache_results' => false)); } elseif ($display == 'tags') { $query = new WP_Query(array('orderby' => 'meta_value_num', 'meta_key' => '_mom_review-final-score', 'meta_value' => 0, 'meta_compare' => '!=', "ignore_sticky_posts" => 1, 'showposts' => $count, 'tag' => $tags, 'no_found_rows' => true, 'cache_results' => false)); } else { $query = new WP_Query(array('orderby' => 'meta_value_num', 'meta_key' => '_mom_review-final-score', 'meta_value' => 0, 'meta_compare' => '!=', "ignore_sticky_posts" => 1, 'showposts' => $count, 'no_found_rows' => true, 'cache_results' => false)); } } elseif ($orderby == 'random') { if ($display == 'cats') { $catsi = implode(',', $cats); $query = new WP_Query(array('meta_key' => '_mom_review-final-score', "orderby" => "rand", 'meta_value' => 0, 'meta_compare' => '!=', "ignore_sticky_posts" => 1, 'showposts' => $count, 'cat' => $catsi, 'no_found_rows' => true, 'cache_results' => false)); } elseif ($display == 'tags') { $query = new WP_Query(array('meta_key' => '_mom_review-final-score', "orderby" => "rand", 'meta_value' => 0, 'meta_compare' => '!=', "ignore_sticky_posts" => 1, 'showposts' => $count, 'tag' => $tags, 'no_found_rows' => true, 'cache_results' => false)); } else { $query = new WP_Query(array('meta_key' => '_mom_review-final-score', "orderby" => "rand", 'meta_value' => 0, 'meta_compare' => '!=', "ignore_sticky_posts" => 1, 'showposts' => $count, 'no_found_rows' => true, 'cache_results' => false)); } } else { if ($display == 'cats') { $catsi = implode(',', $cats); $query = new WP_Query(array('meta_key' => '_mom_review-final-score', 'meta_value' => 0, 'meta_compare' => '!=', "ignore_sticky_posts" => 1, 'showposts' => $count, 'cat' => $catsi, 'no_found_rows' => true, 'cache_results' => false)); } elseif ($display == 'tags') { $query = new WP_Query(array('meta_key' => '_mom_review-final-score', 'meta_value' => 0, 'meta_compare' => '!=', "ignore_sticky_posts" => 1, 'showposts' => $count, 'tag' => $tags, 'no_found_rows' => true, 'cache_results' => false)); } else { $query = new WP_Query(array('meta_key' => '_mom_review-final-score', 'meta_value' => 0, 'meta_compare' => '!=', "ignore_sticky_posts" => 1, 'showposts' => $count, 'no_found_rows' => true, 'cache_results' => false)); } } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); $criterias = get_post_meta(get_the_ID(), '_mom_review-criterias', false); $all_scores = 0; $the_score = 0; $score = 0; if ($criterias != false) { foreach ($criterias[0] as $criteria) { $all_scores += 100; $score += $criteria['cr_score']; } $the_score = $score / $all_scores * 100; $score = round($the_score); } ?> <li itemscope="" itemtype="http://schema.org/Review"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a itemprop="url" href="<?php the_permalink(); ?> " rel="bookmark"> <?php mom_post_image_full('postlist-thumb'); ?> </a></figure> <?php } ?> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h2> <div class="entry-review"> <?php $stars_score = number_format($score / 20, 1, '.', ','); $summary = get_post_meta(get_the_ID(), '_mom_review_summary', true); ?> <span class="rev-title"><?php _e('Review :', 'framework'); ?> </span> <div class="star-rating mom_review_score"><span style="width:<?php echo $score; ?> %;"></span></div> <small>(<?php echo $stars_score; ?> )</small> </div> </li> <?php } ?> <?php } else { ?> <!-- Else in here --> <?php } ?> <?php wp_reset_query(); ?> </ul> <?php /* After widget (defined by themes). */ echo $after_widget; $output = ob_get_contents(); ob_end_clean(); set_transient($this->id, $output, 60 * 60 * 24); } echo $output; }
function mom_news_boxes($atts, $content = null) { global $unique_posts; global $do_unique_posts; extract(shortcode_atts(array('style' => 'nb1', 'title' => '', 'display' => '', 'cat' => '', 'tag' => '', 'number_of_posts' => '4', 'orderby' => '', 'order' => '', 'nb_excerpt' => '', 'sub_categories' => 'no', 'show_more' => 'yes', 'show_more_event' => '', 'post_type' => '', 'exclude_posts' => '', 'class' => ''), $atts)); global $post; $exclude_posts = array($post->ID); $ajax_class = ''; if ($show_more_event == 'ajax') { $ajax_class = 'show_more_ajax'; } if ($style == 'nb6' && $number_of_posts == '4') { $number_of_posts = '3'; } static $id = 75; $id++; if ($cat == 'Select a Category') { $cat = ''; } if ($tag == 'Select a Tag') { $tag = ''; } $head_colors = ''; $head_class = ''; if ($display == 'category' && mom_option('nb_skin') == 'color') { $cat_color = get_option("category_" . $cat); $cat_color = isset($cat_color['color']) ? $cat_color['color'] : ''; if ($cat_color) { $head_colors .= 'style="'; $head_colors .= 'background-color:' . $cat_color . ';'; $head_colors .= '"'; $head_class = 'colorful-box'; } } $output = get_transient('mom_news_boxes_' . $id . $style . $display . $cat . $tag . $orderby . $show_more_event . $post_type); if ($orderby == 'rand') { $output = false; } $output = false; if ($output == false) { ob_start(); $dateformat = mom_option('date_format'); global $wpdb; $tag_ID = $wpdb->get_var("SELECT * FROM " . $wpdb->terms . " WHERE `name` = '" . $tag . "'"); if ($display == 'category') { if ($title == '') { $nb_title = get_cat_name($cat); } else { $nb_title = $title; } $nb_link = get_category_link($cat); } elseif ($display == 'tag') { if ($title == '') { $nb_title = $tag; } else { $nb_title = $title; } $nb_link = get_tag_link($tag_ID); } else { $nb_title = $title; $nb_link = '#'; } $sm_Atts = 'data-display="' . $display . '" data-nbs="' . $style . '" data-number_of_posts="' . $number_of_posts . '" data-cat_id="' . $cat . '" data-nb_excerpt="' . $nb_excerpt . '" data-tag="' . $tag . '"'; $post_meta_hp = mom_option('post_meta_hp'); /* if ($post_meta_hp === null) { $post_meta_hp = 1; } */ if ($post_meta_hp == 1) { $post_head = mom_option('post_head'); $post_head_author = mom_option('post_head_author'); $post_head_date = mom_option('post_head_date'); $post_head_cat = mom_option('post_head_cat'); $post_head_commetns = mom_option('post_head_commetns'); $post_head_views = mom_option('post_head_views'); } else { $post_head = 1; $post_head_author = 1; $post_head_date = 1; $post_head_cat = 1; $post_head_commetns = 1; $post_head_views = 1; } ?> <?php if ($style == 'nb2') { ?> <section class="section news-box <?php if ($display == 'category') { ?> cat_<?php echo $cat; } ?> <?php echo $class; ?> "><!--News box 2--> <header class="block-title <?php echo $head_class; ?> " <?php echo $head_colors; ?> > <h2><a href="<?php echo $nb_link; ?> "><?php echo $nb_title; ?> </a></h2> <?php mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt); ?> </header> <div class="nb2"> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <div <?php post_class('first-item'); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <?php if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 145, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> </div> </div> <?php } } else { } wp_reset_postdata(); ?> <ul> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <li role="article" itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> </li> <?php } } else { } wp_reset_postdata(); ?> </ul> </div> <?php if ($show_more != 'no') { ?> <footer class="newb2 show-more <?php echo $ajax_class; ?> " <?php echo $sm_Atts; ?> > <a href="<?php echo $nb_link; ?> " data-post_type="<?php echo $post_type; ?> " data-offset="<?php echo absint($number_of_posts + 1); ?> " data-orig-offset="<?php echo absint($number_of_posts + 1); ?> "><?php _e('Show More News', 'framework'); ?> </a> </footer> <?php } ?> </section><!--News box 2--> <?php } elseif ($style == 'nb3') { ?> <section class="section news-box <?php if ($display == 'category') { ?> cat_<?php echo $cat; } ?> <?php echo $class; ?> "><!--News box 3--> <header class="block-title <?php echo $head_class; ?> " <?php echo $head_colors; ?> > <h2><a href="<?php echo $nb_link; ?> "><?php echo $nb_title; ?> </a></h2> <?php mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt); ?> </header> <div class="nb3"> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <div <?php post_class('first-item'); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <?php if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> </div> </div> <?php } } else { } wp_reset_postdata(); ?> <ul> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'offset' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'offset' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <li role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb3-thumb'); ?> </a></figure> <?php } ?> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number('0', '1', '%'); ?> </a> </div> <?php } ?> </div> <?php } ?> </li> <?php } } else { } wp_reset_postdata(); ?> </ul> </div> <?php if ($show_more != 'no') { ?> <footer class="show-more <?php echo $ajax_class; ?> " <?php echo $sm_Atts; ?> > <a href="<?php echo $nb_link; ?> " data-post_type="<?php echo $post_type; ?> " data-offset="<?php echo absint($number_of_posts + 2); ?> " data-orig-offset="<?php echo absint($number_of_posts + 2); ?> "><?php _e('Show More News', 'framework'); ?> </a> </footer> <?php } ?> </section><!--News box 3--> <?php } elseif ($style == 'nb4') { ?> <section class="section news-box <?php if ($display == 'category') { ?> cat_<?php echo $cat; } ?> <?php echo $class; ?> "><!--News box 4--> <header class="block-title <?php echo $head_class; ?> " <?php echo $head_colors; ?> > <h2><a href="<?php echo $nb_link; ?> "><?php echo $nb_title; ?> </a></h2> <?php mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt); ?> </header> <div class="nb4"> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <div <?php post_class('first-item'); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <?php if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 110, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> </div> </div> <?php } } else { } wp_reset_postdata(); ?> <ul> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <li role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb3-thumb'); ?> </a></figure> <?php } ?> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <?php } ?> <!-- <div class="comments-link"> <a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> --> </div> <?php } ?> </li> <?php } } else { } wp_reset_postdata(); ?> </ul> </div> <?php if ($show_more != 'no') { ?> <footer class="show-more <?php echo $ajax_class; ?> " <?php echo $sm_Atts; ?> > <a href="<?php echo $nb_link; ?> " data-post_type="<?php echo $post_type; ?> " data-offset="<?php echo absint($number_of_posts + 1); ?> " data-orig-offset="<?php echo absint($number_of_posts + 1); ?> "><?php _e('Show More News', 'framework'); ?> </a> </footer> <?php } ?> </section><!--News box 4--> <?php } elseif ($style == 'nb5') { ?> <section class="section news-box <?php if ($display == 'category') { ?> cat_<?php echo $cat; } ?> <?php echo $class; ?> "><!--News box 5--> <header class="block-title <?php echo $head_class; ?> " <?php echo $head_colors; ?> > <h2><a href="<?php echo $nb_link; ?> "><?php echo $nb_title; ?> </a></h2> <?php mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt); ?> </header> <div class="nb5"> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <div <?php post_class('first-item'); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb5-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <?php if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 180, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> </div> </div> <?php } } else { } wp_reset_postdata(); ?> <ul> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <li role="article" itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> </li> <?php } } else { } wp_reset_postdata(); ?> </ul> </div> <?php if ($show_more != 'no') { ?> <footer class="show-more <?php echo $ajax_class; ?> " <?php echo $sm_Atts; ?> > <a href="<?php echo $nb_link; ?> " data-post_type="<?php echo $post_type; ?> " data-offset="<?php echo absint($number_of_posts + 1); ?> " data-orig-offset="<?php echo absint($number_of_posts + 1); ?> "><?php _e('Show More News', 'framework'); ?> </a> </footer> <?php } ?> </section><!--News box 5--> <?php } elseif ($style == 'nb6') { ?> <section class="section news-box <?php if ($display == 'category') { ?> cat_<?php echo $cat; } ?> <?php echo $class; ?> "><!--news box 6--> <header class="block-title <?php echo $head_class; ?> " <?php echo $head_colors; ?> > <h2><a href="<?php echo $nb_link; ?> "><?php echo $nb_title; ?> </a></h2> <?php mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt); ?> </header> <div class="nb6"> <ul> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <li <?php post_class(); ?> role="article" itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('scroller-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <?php if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 120, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number('0', '1', '%'); ?> </a> </div> <?php } ?> </div> <?php } ?> </div> </li> <?php } } else { } wp_reset_postdata(); ?> </ul> </div> <?php if ($show_more != 'no') { ?> <footer class="show-more <?php echo $ajax_class; ?> " <?php echo $sm_Atts; ?> > <a href="<?php echo $nb_link; ?> " data-post_type="<?php echo $post_type; ?> " data-offset="<?php echo $number_of_posts; ?> " data-orig-offset="<?php echo $number_of_posts; ?> "><?php _e('Show More News', 'framework'); ?> </a> </footer> <?php } ?> </section><!--news box 6--> <?php } elseif ($style == 'list') { ?> <section class="section news-box nb1 news-list <?php if ($display == 'category') { ?> cat_<?php echo $cat; } ?> <?php echo $class; ?> "><!--News box 1--> <header class="block-title <?php echo $head_class; ?> " <?php echo $head_colors; ?> > <h2><a href="<?php echo $nb_link; ?> "><?php echo $nb_title; ?> </a></h2> <?php mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt); ?> </header> <ul> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <li <?php post_class(); ?> itemscope="" itemtype="http://schema.org/Article"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_cat != 0) { ?> <span class="cat-link"> <i class="momizat-icon-folder-open"></i><?php the_category(', '); ?> </span> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <span class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </span> <?php } ?> <div class="clear"></div> </div> <?php } ?> </li> <?php } } else { } wp_reset_postdata(); ?> </ul> <?php if ($show_more != 'no') { ?> <footer class="show-more <?php echo $ajax_class; ?> " <?php echo $sm_Atts; ?> > <a href="<?php echo $nb_link; ?> " data-post_type="<?php echo $post_type; ?> " data-offset="<?php echo $number_of_posts; ?> " data-orig-offset="<?php echo $number_of_posts; ?> "><?php _e('Show More News', 'framework'); ?> </a> </footer> <?php } ?> </section><!--News box 1--> <?php } else { ?> <section class="section news-box nb1 <?php if ($display == 'category') { ?> cat_<?php echo $cat; } ?> <?php echo $class; ?> "><!--News box 1--> <header class="block-title <?php echo $head_class; ?> " <?php echo $head_colors; ?> > <h2><a href="<?php echo $nb_link; ?> "><?php echo $nb_title; ?> </a></h2> <?php mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt); ?> </header> <ul> <?php if ($display == 'category') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <li <?php post_class(); ?> itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('nb1-thumb'); ?> <span class="post-format-icon"></span> </a></figure> <?php } ?> <?php if (mom_post_image() != false) { $mom_class = ' class="fix-right-content"'; } else { $mom_class = ''; } ?> <div<?php echo $mom_class; ?> > <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="entry-content"> <?php if ($nb_excerpt != '0') { ?> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($nb_excerpt == '') { echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...'); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...'); } ?> </p> <?php } ?> </div> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php mom_date_format(); ?> </time> <?php } ?> <?php if ($post_head_commetns != 0) { ?> <div class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </div> <?php } ?> </div> <?php } ?> </div> </li> <?php } } else { } wp_reset_postdata(); ?> </ul> <?php if ($show_more != 'no') { ?> <footer class="show-more <?php echo $ajax_class; ?> " <?php echo $sm_Atts; ?> > <a href="<?php echo $nb_link; ?> " data-post_type="<?php echo $post_type; ?> " data-offset="<?php echo $number_of_posts; ?> " data-orig-offset="<?php echo $number_of_posts; ?> "><?php _e('Show More News', 'framework'); ?> </a> </footer> <?php } ?> </section><!--News box 1--> <?php } ?> <?php $output = ob_get_contents(); ob_end_clean(); set_transient('mom_news_boxes_' . $id . $style . $display . $cat . $tag . $orderby . $show_more_event . $post_type, $output, 60 * 60 * 24); } return $output; }
function mom_new_tabs($atts, $content) { global $unique_posts; global $do_unique_posts; extract(shortcode_atts(array('style' => 'grid', 'columns' => '2', 'switcher' => '', 'class' => ''), $atts)); wp_enqueue_script('tabs'); $hpmeta = mom_option('post_meta_hp'); $rndn = rand(1, 100); $columns_class = 'f-tabbed-cols' . $columns; if ($style == 'list') { $sclass = 'list active'; } else { $sclass = 'list'; } if ($style == 'grid') { $ssclass = 'grid active'; } else { $ssclass = 'grid'; } if (!preg_match_all("/(.?)\\[(news_tab)\\b(.*?)(?:(\\/))?\\]/s", $content, $matches)) { return do_shortcode($content); } else { for ($i = 0; $i < count($matches[0]); $i++) { $matches[3][$i] = shortcode_parse_atts($matches[3][$i]); } $tabs = ''; $tabs .= '<div class="f-tabbed-head"><ul class="f-tabbed-header">'; for ($i = 0; $i < count($matches[0]); $i++) { $display = isset($matches[3][$i]['display']) ? $matches[3][$i]['display'] : ''; $number_of_posts = isset($matches[3][$i]['count']) ? $matches[3][$i]['count'] : ''; $cat = isset($matches[3][$i]['cat']) ? $matches[3][$i]['cat'] : ''; $tag = isset($matches[3][$i]['tag']) ? $matches[3][$i]['tag'] : ''; $orderby = isset($matches[3][$i]['orderby']) ? $matches[3][$i]['orderby'] : ''; $title = isset($matches[3][$i]['title']) ? $matches[3][$i]['title'] : ''; $exc = isset($matches[3][$i]['exc']) ? $matches[3][$i]['exc'] : ''; $offset = isset($matches[3][$i]['offset']) ? $matches[3][$i]['offset'] : ''; if ($title == '' && $display == '') { $title = __('Recent Posts', 'framework'); } elseif ($title == '' && $display == 'cat') { if ($cat != '') { $cat_data = get_category($cat); } $title = $cat_data->name; } elseif ($title == '' && $display == 'tag') { $title = $tag; } $tabs .= '<li class="cat_' . $cat . '"><a href="#">' . $title . '</a></li>'; } $tabs .= '</ul>'; if ($switcher != 'no') { $tabs .= '<ul class="f-tabbed-sort tabbed-sort"><li class="' . $ssclass . '"><a href="#"><span class="brankic-icon-grid"></span> ' . __('Grid', 'framework') . '</a></li><li class="' . $sclass . '"><a href="#"><span class="brankic-icon-list2"></span>' . __('List', 'framework') . '</a></li></ul>'; } $tabs .= '</div>'; ob_start(); $dateformat = mom_option('date_format'); ?> <script> jQuery(document).ready(function($) { $(".nt-<?php echo $rndn; ?> ul.f-tabbed-header").momtabs(".nt-<?php echo $rndn; ?> div.f-tabbed-container > .f-tabbed-body", { effect: 'fade'}); }); </script> <div class="f-tabbed-container"> <?php for ($i = 0; $i < count($matches[0]); $i++) { $display = isset($matches[3][$i]['display']) ? $matches[3][$i]['display'] : ''; $number_of_posts = isset($matches[3][$i]['count']) ? $matches[3][$i]['count'] : ''; $cat = isset($matches[3][$i]['cat']) ? $matches[3][$i]['cat'] : ''; $cats = isset($matches[3][$i]['cats']) ? $matches[3][$i]['cats'] : ''; $tag = isset($matches[3][$i]['tag']) ? $matches[3][$i]['tag'] : ''; $orderby = isset($matches[3][$i]['orderby']) ? $matches[3][$i]['orderby'] : ''; $exc = isset($matches[3][$i]['exc']) ? $matches[3][$i]['exc'] : ''; $offset = isset($matches[3][$i]['offset']) ? $matches[3][$i]['offset'] : ''; ?> <div class="f-tabbed-body cat_<?php echo $cat; ?> "><ul class="f-tabbed-<?php echo $style; ?> <?php echo $columns_class; ?> "> <?php global $wpdb; if ($tag != '') { $tag_ID = $wpdb->get_var("SELECT * FROM " . $wpdb->terms . " WHERE 'name' = '" . $tag . "'"); } if ($orderby == 'popular') { $orderby = 'comment_count'; } elseif ($orderby == 'random') { $orderby = 'rand'; } elseif ($orderby == 'views') { $orderby = 'views'; } else { $orderby = ''; } if ($number_of_posts == "") { $number_of_posts = '6'; } $post_meta_hp = mom_option('post_meta_hp'); if ($post_meta_hp == 1) { $post_head = mom_option('post_head'); $post_head_author = mom_option('post_head_author'); $post_head_date = mom_option('post_head_date'); $post_head_cat = mom_option('post_head_cat'); $post_head_commetns = mom_option('post_head_commetns'); $post_head_views = mom_option('post_head_views'); } else { $post_head = 1; $post_head_author = 1; $post_head_date = 1; $post_head_cat = 1; $post_head_commetns = 1; $post_head_views = 1; } ?> <?php if ($orderby == 'views') { $views_key = 'post_views_count'; if (function_exists('the_views')) { $views_key = 'views'; } if ($display == 'cat') { $query = new WP_Query(array('post_type' => 'post', 'offset' => $offset, 'post_status' => 'publish', 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'meta_key' => $views_key, 'orderby' => 'meta_value_num', 'order' => 'DESC', 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_type' => 'post', 'offset' => $offset, 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'meta_key' => $views_key, 'orderby' => 'meta_value_num', 'order' => 'DESC', 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_type' => 'post', 'offset' => $offset, 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'meta_key' => $views_key, 'orderby' => 'meta_value_num', 'order' => 'DESC', 'category__not_in' => array($cats), 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } } else { if ($display == 'cat') { $query = new WP_Query(array('post_type' => 'post', 'offset' => $offset, 'post_status' => 'publish', 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } elseif ($display == 'tag') { $query = new WP_Query(array('post_type' => 'post', 'offset' => $offset, 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } else { $query = new WP_Query(array('post_type' => 'post', 'offset' => $offset, 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'category__not_in' => array($cats), 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts)); } } update_post_thumbnail_cache($query); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); if ($unique_posts) { $do_unique_posts[] = get_the_ID(); } ?> <li <?php post_class(); ?> itemscope="" itemtype="http://schema.org/Article"> <?php if (mom_post_image() != false) { ?> <figure class="post-thumbnail"><a href="<?php the_permalink(); ?> "> <?php mom_post_image_full('newstabs-thumb'); ?> </a></figure> <?php } ?> <div <?php if (mom_post_image() != false) { ?> class="f-tabbed-list-content"<?php } ?> > <div class="f-p-title"> <h2 itemprop="name"><a itemprop="url" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php if (mom_post_image() != false) { ?> <span class="post-format-icon"></span> <?php } ?> </div> <div class="entry-content"> <p> <?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = get_the_content(''); } if ($exc != '') { echo wp_html_excerpt(strip_shortcodes($excerpt), $exc); } else { echo wp_html_excerpt(strip_shortcodes($excerpt), 154); } ?> ... </p> </div> <?php if ($post_head != 0) { ?> <div class="entry-meta"> <?php if ($post_head_date != 0) { ?> <time class="entry-date" datetime="<?php the_time('c'); ?> " itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php the_time($dateformat); ?> </time> <?php } ?> <?php if ($post_head_cat != 0) { ?> <span class="comments-link"> <i class="momizat-icon-bubbles4"></i><a href="<?php comments_link(); ?> "><?php comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework')); ?> </a> </span> <?php } ?> <?php if ($post_head_views != 0) { ?> <span class="post-views"> <i class="momizat-icon-eye"></i><?php echo getPostViews(get_the_ID()); ?> </span> <?php } ?> </div> <?php } ?> </div> </li> <?php } } else { } wp_reset_postdata(); ?> </ul> <?php if ($display != '') { $link = ''; if ($display == 'cat') { $link = get_category_link($cat); } if ($display == 'tag') { $tag_id = get_term_by('name', $tag, 'post_tag'); if ($tag_id) { $tag_id = $tag_id->term_id; } $link = get_tag_link($tag_id); } ?> <footer class="show-more"><a href="<?php echo $link; ?> " class="tabs-show-more"><?php _e('Show More', 'framework'); ?> </a></footer> <?php } ?> </div> <?php } ?> </div> <?php $content = ob_get_contents(); ob_end_clean(); return '<section class="section ' . $class . '"><div class="feature-tabbed nt-' . $rndn . '">' . $tabs . $content . '</div></section>'; } }