function hui_posts_focus() { $html = ''; $html .= '<li class="large"><a' . hui_target_blank() . ' href="' . _hui('focus_href') . '"><img class="thumb" data-original="' . _hui('focus_src') . '"><h4>' . _hui('focus_title') . '</h4></a></li>'; $sticky = get_option('sticky_posts'); rsort($sticky); query_posts(array('post__in' => $sticky, 'ignore_sticky_posts' => 1, 'showposts' => 4)); if (have_posts()) { while (have_posts()) { the_post(); $html .= '<li><a' . hui_target_blank() . ' href="' . get_permalink() . '">'; $html .= hui_get_thumbnail(); $html .= '<h4>' . get_the_title() . '</h4>'; $html .= '</a></li>'; } } wp_reset_query(); echo '<div class="focusmo"><ul>' . $html . '</ul></div>'; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_name', $instance['title']); $limit = $instance['limit']; $cat = $instance['cat']; $orderby = $instance['orderby']; $showstyle = $instance['showstyle']; // $img = $instance['img']; $style = ' class="' . $showstyle . '"'; echo $before_widget; echo $before_title . $title . $after_title; echo '<ul' . $style . '>'; $args = array('order' => DESC, 'cat' => $cat, 'orderby' => $orderby, 'showposts' => $limit, 'ignore_sticky_posts' => 1); query_posts($args); while (have_posts()) { the_post(); ?> <li><a<?php echo hui_target_blank(); ?> href="<?php the_permalink(); ?> "><?php if ($showstyle !== 'items-03') { echo '<span class="thumbnail">' . hui_get_thumbnail() . '</span>'; } ?> <span class="text"><?php the_title(); ?> </span><?php echo hui_get_views($class = 'text-muted post-views'); ?> </a></li> <?php } wp_reset_query(); echo '</ul>'; echo $after_widget; }
function hui_posts_sticky() { $title = _hui('sticky_title'); $showposts = _hui('sticky_limit'); $sticky = get_option('sticky_posts'); rsort($sticky); query_posts(array('post__in' => $sticky, 'ignore_sticky_posts' => 1, 'showposts' => $showposts)); if (have_posts()) { printf('<div class="sticky"><h3 class="title"><strong>' . $title . '</strong></h3><ul>'); while (have_posts()) { the_post(); echo '<li class="item"><a' . hui_target_blank() . ' href="' . get_permalink() . '">'; echo hui_get_thumbnail(); echo get_the_title(); echo '</a></li>'; } printf('</ul></div>'); } wp_reset_query(); }
function hui_posts_related($title = '', $limit = 8) { global $post; $exclude_id = $post->ID; $posttags = get_the_tags(); $i = 0; echo '<div class="relates"><h3 class="title"><strong>' . $title . '</strong></h3><ul>'; if ($posttags) { $tags = ''; foreach ($posttags as $tag) { $tags .= $tag->name . ','; } $args = array('post_status' => 'publish', 'tag_slug__in' => explode(',', $tags), 'post__not_in' => explode(',', $exclude_id), 'caller_get_posts' => 1, 'orderby' => 'comment_date', 'posts_per_page' => $limit); query_posts($args); while (have_posts()) { the_post(); echo '<li><a' . hui_target_blank() . ' href="' . get_permalink() . '">' . hui_get_thumbnail() . get_the_title() . '</a></li>'; $exclude_id .= ',' . $post->ID; $i++; } wp_reset_query(); } if ($i < $limit) { $cats = ''; foreach (get_the_category() as $cat) { $cats .= $cat->cat_ID . ','; } $args = array('category__in' => explode(',', $cats), 'post__not_in' => explode(',', $exclude_id), 'caller_get_posts' => 1, 'orderby' => 'comment_date', 'posts_per_page' => $limit - $i); query_posts($args); while (have_posts()) { the_post(); echo '<li><a' . hui_target_blank() . ' href="' . get_permalink() . '">' . hui_get_thumbnail() . get_the_title() . '</a></li>'; $i++; } wp_reset_query(); } /*if ( $i == 0 ){ return false; }*/ echo '</ul></div>'; }
* Template Name: Likes Page * By daqianduan.com */ get_header(); ?> <div class="content-wrap"> <div class="content page-likes no-sidebar"> <h1 class="title"><strong><?php echo get_the_title(); ?> </strong></h1> <ul class="likepage"> <?php $args = array('caller_get_posts' => 1, 'meta_key' => 'like', 'orderby' => 'meta_value_num', 'showposts' => 40); query_posts($args); while (have_posts()) { the_post(); $count = hui_post_images_number(); $like = get_post_meta(get_the_ID(), 'like', true); echo '<li><a href="' . get_permalink() . '">' . hui_get_thumbnail() . '<h2>' . get_the_title() . '</h2></a>', hui_get_post_like($class = 'post-like'), '<span class="img-count"><span class="glyphicon glyphicon-picture"></span>' . $count . '</span>', '</li>'; } wp_reset_query(); ?> </ul> <?php comments_template('', true); ?> </div> </div> <?php get_footer();
if ($has_thumb || $img_number > 0) { $classname = ' excerpt-one'; } } else { if ($etype == 'multi' || $etype == 'four') { $imgSingle = false; if ($has_thumb || $img_number > 0 && $img_number < 4) { $classname = ' excerpt-one'; } else { if (!$has_thumb && $img_number >= 4) { $classname = ' excerpt-multi'; } } } } $focuscode = hui_get_thumbnail($imgSingle, false); $focuscode = $focuscode ? '<p class="focus"><a' . hui_target_blank() . ' href="' . get_permalink() . '" class="thumbnail">' . $focuscode . '</a></p>' : ''; } $author = get_the_author(); if (_hui('author_link')) { $author = '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . $author . '</a>'; } $p_meta = _hui('post_plugin'); echo '<article class="excerpt' . $classname . '">'; echo '<header>'; if (!is_category()) { $category = get_the_category(); if ($category[0]) { echo '<a class="cat label label-important" href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '<i class="label-arrow"></i></a> '; } }