* 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();
function hui_post_excerpt() { $listtype = _hui('list_type'); while (have_posts()) { the_post(); $classname = ''; $focus = ''; if ($listtype !== 'none') { $imgNum = hui_post_images_number(); $has_thumb = has_post_thumbnail(); if ($listtype == 'thumb') { $imgSingle = true; if ($has_thumb || $imgNum > 0) { $classname = ' excerpt-one'; } } else { if ($listtype == 'multi') { $imgSingle = false; if ($has_thumb || $imgNum > 0 && $imgNum < 4) { $classname = ' excerpt-one'; } else { if (!$has_thumb && $imgNum >= 4) { $classname = ' excerpt-multi'; } } } } $focus = hui_get_thumbnail($imgSingle, false); $focus = $focus ? '<p class="focus"><a' . hui_target_blank() . ' href="' . get_permalink() . '" class="thumbnail">' . $focus . '</a></p>' : ''; } $pls = _hui('post_plugin'); $author = get_the_author(); if (_hui('author_link')) { $author = '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . $author . '</a>'; } 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> '; } } echo '<h2><a' . hui_target_blank() . ' href="' . get_permalink() . '" title="' . get_the_title() . _hui('connector') . get_bloginfo('name') . '">' . get_the_title() . '</a></h2>'; if ($imgNum) { echo '<small class="text-muted"><span class="glyphicon glyphicon-picture"></span>' . $imgNum . '</small>'; } echo '</header>', '<p class="text-muted time">' . ($pls && $pls['siteauthor'] ? get_bloginfo('name') . ' - ' : '') . $author . ' ' . __('发布于', 'haoui') . ' ' . timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s'))) . '</p>', $focus, '<p class="note">' . hui_get_excerpt_content() . '</p>', '<p class="text-muted views">' . hui_get_views() . '</span>', $pls && $pls['comm'] ? '<span class="post-comments">' . hui_get_comment_number() . '</span>' : '', hui_get_post_like($class = 'post-like'), the_tags('<span class="post-tags">' . __('标签:', 'haoui'), ' / ', '</span>'), '</p>'; echo '</article>'; } wp_reset_query(); hui_paging(); }
<?php /* * list excerpt * ==================================================== */ $etype = _hui('list_type'); while (have_posts()) { the_post(); $classname = ''; $focuscode = ''; if ($etype !== 'none') { $img_number = hui_post_images_number(); $has_thumb = has_post_thumbnail(); if ($etype == 'thumb') { $imgSingle = true; 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'; } } } }