?> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> " class=""> <div class="thumb-img"> <img <?php echo $lazy; ?> ="<?php $imgsrc = catch_first_image(); echo tin_thumb_source($imgsrc, 175, 126, false); ?> "> <span><?php the_article_icon(); ?> </span> </div> </a> <?php } ?> </div> <div class="relpost-inner-text"> <a href="<?php the_permalink();
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; } 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'])))); ?> <?php if (ot_get_option('lazy_load_img') == 'on') { $lazy = 'class="box-hide" src="' . THEME_URI . '/images/image-pending.gif" data-original'; } else { $lazy = 'src'; } ?> <ul class="tin-posts group <?php if ($instance['posts_thumb']) { echo 'thumbs-enabled'; } ?> "> <?php $i = 0; ?> <?php while ($posts->have_posts()) { $posts->the_post(); ?> <?php $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); ?> <?php $r = fmod($i, 2); $i++; ?> <?php if ($instance['posts_thumb']) { // Thumbnails enabled? ?> <li class="<?php if ($r == 0) { echo 'list-left'; } else { echo 'list-right'; } ?> "> <div class="post-item-thumbnail"> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "> <?php if (has_post_thumbnail()) { ?> <img <?php echo $lazy; ?> ="<?php $imgsrc = $large_image_url[0]; echo tin_thumb_source($imgsrc, 353, 220, false); ?> " alt="<?php the_title(); ?> " /> <?php } else { ?> <img <?php echo $lazy; ?> ="<?php $imgsrc = catch_first_image(); echo tin_thumb_source($imgsrc, 353, 220, false); ?> " alt="<?php the_title(); ?> " /> <?php } ?> </a> <div class="tin-posts-float-title"> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a> </div> </div> <div class="post-item-inner group"> <?php if ($instance['posts_date']) { ?> <span class="post-item-date" style="float:left;"><?php the_time('Y-m-j'); ?> </span><?php } ?> <?php if ($instance['posts_category']) { ?> <span class="post-item-category" style="float:right;"><?php the_category(' / '); ?> </span><?php } ?> </div> <?php } else { ?> <li class="list-single-col"> <div class="tin-posts-title"> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a> <?php if ($instance['posts_date']) { ?> <span class="post-item-date" style="float:right;"><?php the_time('Y-m-j'); ?> </span><?php } ?> </div> <?php } ?> </li> <?php } ?> </ul> <?php $output .= ob_get_clean(); $output .= $after_widget . "\n"; echo $output; }
} ?> <li> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> " rel="bookmark" class="fancyimg"> <div class="thumb-img"> <img <?php echo $lazy; ?> ="<?php echo tin_thumb_source($imgsrc, 280, 180, false); ?> " alt="<?php the_title(); ?> "> <span><?php the_article_icon(); ?> </span> </div> </a> <p><?php the_title(); ?> </p>
if (has_post_thumbnail() && ot_get_option('show-single-thumb') == 'on') { $url = get_post_meta($post->ID, 'tin_thumb_url', true); $url = explode('|', $url); $link = isset($url[0]) ? $url[0] : ''; $title = isset($url[1]) ? $url[1] : ''; ?> <a href="<?php echo $link; ?> " title="<?php echo $title; ?> " target="_blank"><?php $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); $url = $large_image_url[0]; $url = tin_thumb_source($url, 800, 300); ?> <img src="<?php echo $url; ?> " /></a> <div id="singlethumb-banner"><?php echo ot_get_option('singlethumbad'); ?> </div> <?php } ?> </div> <div class="single-text"> <?php
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; } ob_start(); /* Set tabs-nav order & output it /* ------------------------------------ */ $titles = array('recent' => $instance['title_latestpost'], 'popular' => $instance['title_hotpost'], 'comments' => $instance['title_comment']); $tabs = array(); $count = 0; $order = array('recent' => $instance['order_recent'], 'popular' => $instance['order_popular'], 'comments' => $instance['order_comments']); asort($order); foreach ($order as $key => $value) { if ($instance[$key . '_enable']) { $tabs[] = $key; $count++; } } if ($tabs && $count > 1) { $output .= $this->_create_tabs($titles, $tabs, $count); } ?> <?php if (ot_get_option('lazy_load_img') == 'on') { $lazy = 'class="box-hide" src="' . THEME_URI . '/images/image-pending.gif" data-original'; } else { $lazy = 'src'; } ?> <div class="tin-tabs-container"> <?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'); ?> <ul id="tab-recent" class="tin-tab group <?php if ($instance['recent_thumbs']) { echo 'thumbs-enabled'; } else { echo 'no-pic'; } ?> "> <?php while ($recent->have_posts()) { $recent->the_post(); ?> <?php $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); ?> <li> <?php if ($instance['recent_thumbs']) { // Thumbnails enabled? ?> <div class="tab-item-thumbnail"> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "> <?php if (has_post_thumbnail()) { ?> <div class="thumb-img"> <img <?php echo $lazy; ?> ="<?php echo tin_thumb_source($large_image_url[0], 125, 78, false); ?> " alt="<?php the_title(); ?> " /> <span><?php the_article_icon(); ?> </span> </div> <?php } else { ?> <div class="thumb-img"> <img <?php echo $lazy; ?> ="<?php $img = catch_first_image(); echo tin_thumb_source($img, 125, 78, false); ?> " alt="<?php the_title(); ?> " /> <span><?php the_article_icon(); ?> </span> </div> <?php } ?> </a> </div> <?php } ?> <div class="tab-item-inner group"> <p class="tab-item-title"><a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a></p> <?php if ($instance['tabs_date']) { ?> <span class="tab-item-date"><?php the_time('Y-m-j'); ?> </span><?php } ?> <?php if ($instance['tabs_category']) { ?> <span class="tab-item-category"><?php the_category(' / '); ?> </span><?php } ?> </div> </li> <?php } ?> </ul><!--/.tin-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'])))); ?> <ul id="tab-popular" class="tin-tab group <?php if ($instance['popular_thumbs']) { echo 'thumbs-enabled'; } else { echo 'no-pic'; } ?> "> <?php while ($popular->have_posts()) { $popular->the_post(); ?> <?php $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); ?> <li> <?php if ($instance['popular_thumbs']) { // Thumbnails enabled? ?> <div class="tab-item-thumbnail"> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "> <?php if (has_post_thumbnail()) { ?> <div class="thumb-img"> <img <?php echo $lazy; ?> ="<?php echo tin_thumb_source($large_image_url[0], 125, 78, false); ?> " alt="<?php the_title(); ?> " /> <span><?php the_article_icon(); ?> </span> </div> <?php } else { ?> <div class="thumb-img"> <img <?php echo $lazy; ?> ="<?php $img = catch_first_image(); echo tin_thumb_source($img, 125, 78, false); ?> " alt="<?php the_title(); ?> " /> <span><?php the_article_icon(); ?> </span> </div> <?php } ?> </a> </div> <?php } ?> <div class="tab-item-inner group"> <p class="tab-item-title"><a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a></p> <?php if ($instance['tabs_date']) { ?> <span class="tab-item-date"><?php the_time('Y-m-j'); ?> </span><?php } ?> <?php if ($instance['tabs_category']) { ?> <span class="tab-item-category"><?php the_category(' / '); ?> </span><?php } ?> </div> </li> <?php } ?> </ul><!--/.tin-tab--> <?php } ?> <?php if ($instance['comments_enable']) { // Recent comments enabled? ?> <?php $args = array('number' => $instance["comments_num"], 'status' => 'approve', 'post_status' => 'publish'); if (isset($instance['comment_order']) && $instance['comment_order'] == 'vote') { $args['orderby'] = 'meta_value_num'; $args['meta_key'] = 'tin_comment_voteyes'; } $comments = get_comments($args); ?> <ul id="tab-comments" class="tin-tab group <?php if ($instance['comments_avatars']) { echo 'avatars-enabled'; } else { echo 'no-avatar'; } ?> "> <?php foreach ($comments as $comment) { ?> <li> <?php if ($instance['comments_avatars']) { // Avatars enabled? ?> <div class="tab-item-avatar"> <?php echo tin_get_avatar($comment->user_id, '96', tin_get_avatar_type($comment->user_id)); ?> </div> <?php } ?> <div class="tab-item-inner group"> <?php $comment_excerpt = preg_replace("'\\[private](.*?)\\[\\/private]'", '***该评论仅父级评论者及管理员可见***', get_comment_excerpt($comment->comment_ID)); $str = explode(' ', $comment_excerpt); $comment_excerpt = implode(' ', array_slice($str, 0, 11)); if (count($str) > 11 && substr($comment_excerpt, -1) != '.') { $comment_excerpt .= '...'; } ?> <div class="tab-item-comment"><span class="arrow-poptop"></span><a href="<?php echo esc_url(get_permalink($comment->comment_post_ID)); ?> "><i><?php echo $comment->comment_author; ?> </i><?php _e('说: ', 'xiapistudio'); echo $comment_excerpt; ?> </a><div class="tab-cmt-votes"><span class="cmt-vote"> <?php $c_name = 'tin_comment_vote_' . $comment->comment_ID; $cookie = isset($_COOKIE[$c_name]) ? $_COOKIE[$c_name] : ''; ?> <i class="fa fa-thumbs-o-up <?php if ($cookie == 1) { echo 'voted'; } ?> " title="<?php _e('顶', 'xiapistudio'); ?> " data="<?php echo $comment->comment_ID; ?> " data-type="1" data-num="<?php echo (int) get_comment_meta($comment->comment_ID, 'tin_comment_voteyes', true); ?> "><?php echo ' [' . (int) get_comment_meta($comment->comment_ID, 'tin_comment_voteyes', true) . ']'; ?> </i> <i class="fa fa-thumbs-o-down <?php if ($cookie == 2) { echo 'voted'; } ?> " title="<?php _e('踩', 'xiapistudio'); ?> " data="<?php echo $comment->comment_ID; ?> " data-type="2" data-num="<?php echo (int) get_comment_meta($comment->comment_ID, 'tin_comment_voteno', true); ?> "><?php echo ' [' . (int) get_comment_meta($comment->comment_ID, 'tin_comment_voteno', true) . ']'; ?> </i> </span></div></div> </div> </li> <?php } ?> </ul><!--/.tin-tab--> <?php } ?> </div> <?php $output .= ob_get_clean(); $output .= $after_widget . "\n"; echo $output; }
?> "/><div class="slider-video"><a rel="iframes" class="" href="javascript:" data="<?php echo $video; ?> "><span></span></a></div></div> <?php } else { ?> <a class="slider-img" href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "><img src="<?php echo tin_thumb_source($img, 600, 336, false); ?> " alt="<?php the_title(); ?> "/></a> <?php } ?> <div class="slider-text"> <div class="cl"> <div class="slider-meta"> <span class="num"><?php if ($i < 10) { echo '0' . $i; } else {
?> " class="fancyimg home-blog-entry-thumb" rel="prettyPhoto[iframe]"> <?php } else { ?> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> " class="fancyimg home-blog-entry-thumb"> <?php } ?> <div class="thumb-img"> <img src="<?php echo tin_thumb_source($imgsrc); ?> " alt="<?php the_title(); ?> "> <span><?php the_article_icon(); ?> </span> </div> </a> <?php }
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; } 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'])))); ?> <script type="text/javascript"> $(document).ready(function(){ $('.tin-slider').flexslider({ animation: "fade", direction:"horizontal", easing:"swing", pauseOnHover:true, slideshowSpeed: 5000, animationDuration:600, prevText: "", nextText: "", directionNav:false, randomize:true }); }); </script> <div class="tin-slider"> <ul class="slides"> <?php while ($posts->have_posts()) { $posts->the_post(); ?> <?php $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); ?> <li> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "> <?php if (has_post_thumbnail()) { ?> <img src="<?php $imgsrc = $large_image_url[0]; echo tin_thumb_source($imgsrc, 350, 250, false); ?> " alt="<?php the_title(); ?> " style="width:350px;height:250px;" /> <?php } else { ?> <img src="<?php $imgsrc = catch_first_image(); echo tin_thumb_source($imgsrc, 350, 250, false); ?> " alt="<?php the_title(); ?> " style="width:350px;height:250px;" /> <?php } ?> </a> <div class="widget-slider-title trans"> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a> </div> </li> <?php } wp_reset_query(); ?> </ul> </div> <?php $output .= ob_get_clean(); $output .= $after_widget . "\n"; echo $output; }
?> " title="<?php echo $post_title; ?> " class="fancyimg"> <div class="thumb-img"> <?php $imgsrc = tin_thumbnail(); $imgtype = substr($imgsrc, strrpos($imgsrc, '.')); if ($imgtype != '.gif') { ?> <img <?php echo $lazy; ?> ="<?php echo tin_thumb_source($imgsrc, 98, 72); ?> " alt="<?php echo $post_title; ?> "> <span></span> <?php } else { ?> <img <?php echo $lazy; ?> ="<?php echo $imgsrc; ?>