Example #1
0
    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;
    }
Example #2
0
    echo __('发布于', 'haoui');
    ?>
 <?php 
    echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
    ?>
</li>
				<li><?php 
    echo __('分类:', 'haoui');
    the_category(' / ');
    ?>
</li>
				<?php 
    echo hui_get_post_from() ? '<li>' . hui_get_post_from() . '</li>' : '';
    ?>
				<li><?php 
    echo hui_get_views();
    ?>
</li>
				<li><?php 
    echo hui_get_comment_number();
    ?>
</li>
				<li><?php 
    edit_post_link('[' . __('编辑', 'haoui') . ']');
    ?>
</li>
			</ul>
		</header>
		<?php 
    if (_hui('ads_post_01_s')) {
        echo '<div class="ads ads-content ads-post">' . _hui('ads_post_01') . '</div>';
Example #3
0
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();
}
Example #4
0
            }
        }
        $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> ';
        }
    }
    echo '<h2><a' . hui_target_blank() . ' href="' . get_permalink() . '" title="' . get_the_title() . _hui('connector') . get_bloginfo('name') . '">' . get_the_title() . '</a></h2>';
    if ($img_number) {
        echo '<small class="text-muted"><span class="glyphicon glyphicon-picture"></span>' . $img_number . '</small>';
    }
    echo '</header>', '<p class="text-muted time">' . ($p_meta && $p_meta['siteauthor'] ? get_bloginfo('name') . ' - ' : '') . $author . ' ' . __('发布于', 'haoui') . ' ' . hui_get_post_date(get_gmt_from_date(get_the_time('Y-m-d G:i:s'))) . '</p>', $focuscode, '<p class="note">' . hui_get_excerpt_content() . '</p>', '<p class="text-muted views">';
    if (_hui('post_link_excerpt_s')) {
        hui_post_link();
    }
    echo hui_get_views(), $p_meta && $p_meta['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>';
}
hui_paging();
wp_reset_query();