the_permalink(); ?> " title="<?php the_title(); ?> "> <img src="<?php $src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'carousel-block', false, ''); echo $src[0]; ?> " alt="<?php the_title(); ?> "> <?php format_icon(); ?> </a> <?php get_review(); ?> </div> </div><!-- /item --> </div><!-- /thumbnail --> <h3 class="post-title entry-title"><a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "><?php
public function widget($args, $instance) { extract($args); $instance['title'] ? NULL : ($instance['title'] = ''); $title = apply_filters('widget_title', $instance['title']); $output = "\n"; ob_start(); /* Set tabs-nav order & output it /* ------------------------------------ */ $tabs = array(); $count = 0; $order = array('recent' => $instance['order_recent'], 'popular' => $instance['order_popular'], 'comments' => $instance['order_comments'], 'tags' => $instance['order_tags']); asort($order); foreach ($order as $key => $value) { if ($instance[$key . '_enable']) { $tabs[] = $key; $count++; } } if ($tabs && $count > 1) { $output .= $this->_create_tabs($tabs, $count); } ?> <div class="widget clearfix introfx more_posts"> <?php if ($instance['recent_enable']) { // Recent posts enabled? ?> <?php $recent = new WP_Query(); ?> <?php $recent->query('showposts=' . $instance["recent_num"] . '&cat=' . $instance["recent_cat_id"] . '&ignore_sticky_posts=1'); ?> <div id="tab-recent" class="T20-tab group"> <?php while ($recent->have_posts()) { $recent->the_post(); ?> <div class="item_small"> <div class="one_post"> <?php if ($instance['recent_thumbs']) { // Thumbnails enabled? ?> <?php if (has_post_thumbnail()) { ?> <div class="featured_thumb"> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "> <?php the_post_thumbnail('thumbnail'); ?> <?php format_icon(); ?> </a> </div> <?php } ?> <?php } ?> <div class="item-details"> <h3><a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a></h3> <div class="post_meta"> <?php if ($instance['tabs_date']) { ?> <a href="<?php echo get_month_link(get_the_time('Y'), get_the_time('m')); ?> " rel="date" title="<?php the_title(); ?> "><i class="icon-calendar mi"></i><?php the_time('j M, Y'); ?> </a> <a href="<?php comments_link(); ?> "><i class="icon-message mi"></i><?php comments_number('0', '1', '%'); ?> </a><?php } ?> </div> </div> </div> </div> <?php } ?> </div><!--/.T20-tab--> <?php } ?> <?php if ($instance['popular_enable']) { // Popular posts enabled? ?> <?php $popular = new WP_Query(array('post_type' => array('post'), 'showposts' => $instance['popular_num'], 'cat' => $instance['popular_cat_id'], 'ignore_sticky_posts' => true, 'orderby' => 'comment_count', 'order' => 'dsc', 'date_query' => array(array('after' => $instance['popular_time'])))); ?> <div id="tab-popular" class="T20-tab group"> <?php while ($popular->have_posts()) { $popular->the_post(); ?> <div class="item_small"> <div class="one_post"> <?php if ($instance['popular_thumbs']) { // Thumbnails enabled? ?> <?php if (has_post_thumbnail()) { ?> <div class="featured_thumb"> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "> <?php the_post_thumbnail('thumbnail'); ?> <?php format_icon(); ?> </a> </div> <?php } ?> <?php } ?> <div class="item-details"> <h3><a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a></h3> <div class="post_meta"> <?php if ($instance['tabs_date']) { ?> <a href="<?php echo get_month_link(get_the_time('Y'), get_the_time('m')); ?> " rel="date" title="<?php the_title(); ?> "><i class="icon-calendar mi"></i><?php the_time('j M, Y'); ?> </a> <a href="<?php comments_link(); ?> "><i class="icon-message mi"></i><?php comments_number('0', '1', '%'); ?> </a><?php } ?> </div> </div> </div> </div> <?php } ?> </div><!--/.T20-tab--> <?php } ?> <?php if ($instance['comments_enable']) { // Recent comments enabled? ?> <?php $comments = get_comments(array('number' => $instance["comments_num"], 'status' => 'approve', 'post_status' => 'publish')); ?> <div id="tab-comments" class="T20-tab group"> <?php foreach ($comments as $comment) { ?> <div class="item_small"> <div class="one_post"> <?php if ($instance['comments_avatars']) { // Avatars enabled? ?> <div class="featured_thumb"> <a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?> "> <?php echo get_avatar($comment->comment_author_email, $size = '96'); ?> </a> </div> <?php } ?> <div class="item-details"> <?php $str = explode(' ', get_comment_excerpt($comment->comment_ID)); $comment_excerpt = implode(' ', array_slice($str, 0, 11)); if (count($str) > 11 && substr($comment_excerpt, -1) != '.') { $comment_excerpt .= '...'; } ?> <a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?> "><?php echo $comment->comment_author; ?> <small><?php _e('says:', 'T20'); ?> </small></a> <div class="post_meta"> <?php echo $comment_excerpt; ?> </div> </div> </div> </div> <?php } ?> </div><!--/.T20-tab--> <?php } ?> <?php if ($instance['tags_enable']) { // Tags enabled? ?> <div id="tab-tags" class="T20-tab tagcloud group"> <?php wp_tag_cloud(); ?> </div><!--/tab--> <?php } ?> </div> <?php $output .= ob_get_clean(); $output .= "\n"; echo $output; }
public function widget($args, $instance) { extract($args); $instance['title'] ? NULL : ($instance['title'] = ''); $title = apply_filters('widget_title', $instance['title']); $output = $before_widget . "\n"; if ($title) { $output .= $before_title . $title . $after_title; } else { $output .= '<div class="widget clearfix">'; } ob_start(); ?> <?php $posts = new WP_Query(array('post_type' => array('post'), 'showposts' => $instance['posts_num'], 'cat' => $instance['posts_cat_id'], 'ignore_sticky_posts' => true, 'orderby' => $instance['posts_orderby'], 'order' => 'dsc', 'date_query' => array(array('after' => $instance['posts_time'])))); ?> <div class="more_posts"> <?php while ($posts->have_posts()) { $posts->the_post(); ?> <div class="item_small"> <div class="one_post"> <?php if ($instance['posts_thumb']) { // Thumbnails enabled? ?> <?php if (has_post_thumbnail()) { ?> <div class="featured_thumb"> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "> <?php the_post_thumbnail('thumbnail'); ?> <?php format_icon(); ?> </a> </div> <?php } ?> <?php } ?> <div class="item-details"> <h3><a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a></h3> <div class="post_meta"> <?php if ($instance['posts_date']) { ?> <a href="<?php echo get_month_link(get_the_time('Y'), get_the_time('m')); ?> " rel="date"><i class="icon-calendar mi"></i><?php the_time('j M, Y'); ?> </a> <a href="<?php comments_link(); ?> "><i class="icon-message mi"></i><?php comments_number('0', '1', '%'); ?> </a><?php } ?> </div> </div> </div> </div> <?php } ?> </div><!--/.T20-posts--> <?php $output .= ob_get_clean(); $output .= $after_widget . "\n"; echo $output; }
public function widget($args, $instance) { extract($args); $instance['title'] ? NULL : ($instance['title'] = ''); $title = apply_filters('widget_title', $instance['title']); $output = $before_widget . "\n"; if ($title) { $output .= $before_title . $title . $after_title; } else { $output .= '<div class="b_title"><h4> </h4></div><div class="widget clearfix">'; } ob_start(); ?> <?php $posts = new WP_Query(array('post_type' => array('post'), 'showposts' => $instance['posts_num'], 'cat' => $instance['posts_cat_id'], 'ignore_sticky_posts' => true, 'orderby' => $instance['posts_orderby'], 'order' => 'dsc', 'date_query' => array(array('after' => $instance['posts_time'])))); ?> <div class="gallery_widget gallery_widget_posts owl-carousel owl-theme"> <?php while ($posts->have_posts()) { $posts->the_post(); ?> <?php if (has_post_thumbnail()) { ?> <div class="item wgr T_post"> <div class="featured_thumb"> <a class="first_A" href="<?php the_permalink(); ?> " title="<?php the_title(); ?> " rel="bookmark" > <?php the_post_thumbnail('blocktwo'); ?> <?php format_icon(); ?> <h3><?php the_title(); ?> </h3> </a> </div> <div class="details"> <span class="s_category"> <a href="<?php echo get_month_link(get_the_time('Y'), get_the_time('m')); ?> " rel="date"><i class="icon-calendar mi"></i> <?php the_time('j M, Y'); ?> </a> <a rel="author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> "><i class="icon-user mi"></i><?php echo get_the_author(); ?> </a> </span> <span class="more_meta"><a href="<?php comments_link(); ?> "><i class="icon-message mi"></i> <?php comments_number('0', '1', '%'); ?> </a></span> </div> </div> <?php } ?> <?php } ?> </div><!--/slideshow--> <?php $output .= ob_get_clean(); $output .= $after_widget . "\n"; echo $output; }