Example #1
0
/**
 * [mo_minicat description]
 * @return html [description]
 */
function mo_minicat()
{
    if (!_hui('minicat')) {
        return;
    }
    $args = array('ignore_sticky_posts' => 1, 'showposts' => 1, 'cat' => _hui('minicat'));
    query_posts($args);
    while (have_posts()) {
        the_post();
        $category = get_the_category();
        echo '<article class="excerpt-minic excerpt-minic-index">';
        echo '<h2><a' . _post_target_blank() . ' class="red" href="' . get_category_link($category[0]->term_id) . '">【' . (_hui('minicat_home_title') ? _hui('minicat_home_title') : '今日观点') . '】</a> <a href="' . get_permalink() . '" title="' . get_the_title() . _get_delimiter() . get_bloginfo('name') . '">' . get_the_title() . '</a></h2>';
        echo '<p class="note">' . _get_excerpt() . '</p>';
        echo '</article>';
    }
    wp_reset_query();
}
Example #2
0
$p_meta = _hui('post_plugin');
while (have_posts()) {
    the_post();
    $ii++;
    echo '<article class="excerpt excerpt-' . $ii . (_hui('list_type') == 'text' ? ' excerpt-text' : '') . '">';
    if (_hui('list_type') !== 'text') {
        echo '<a' . _post_target_blank() . ' class="focus" href="' . get_permalink() . '">' . _get_post_thumbnail() . '</a>';
    }
    echo '<header>';
    if ($p_meta && $p_meta['cat'] && !is_category()) {
        $category = get_the_category();
        if ($category[0]) {
            echo '<a class="cat" href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '<i></i></a> ';
        }
    }
    echo '<h2><a' . _post_target_blank() . ' href="' . get_permalink() . '" title="' . get_the_title() . _get_delimiter() . get_bloginfo('name') . '">' . get_the_title() . '</a></h2>';
    echo '</header>';
    echo '<p class="meta">';
    if ($p_meta && $p_meta['date']) {
        echo '<time><i class="fa fa-clock-o"></i>' . get_the_time('Y-m-d') . '</time>';
    }
    if ($p_meta && $p_meta['author']) {
        $author = get_the_author();
        if (_hui('author_link')) {
            $author = '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . $author . '</a>';
        }
        echo '<span class="author"><i class="fa fa-user"></i>' . $author . '</span>';
    }
    if ($p_meta && $p_meta['view']) {
        echo '<span class="pv"><i class="fa fa-eye"></i>' . _get_post_views() . '</span>';
    }
Example #3
0
function dd_sticky_posts_list($limit, $img)
{
    $sticky = get_option('sticky_posts');
    rsort($sticky);
    $args = array('post__in' => $sticky, 'showposts' => $limit, 'ignore_sticky_posts' => 1);
    query_posts($args);
    while (have_posts()) {
        the_post();
        ?>
<li><a<?php 
        echo _post_target_blank();
        ?>
 href="<?php 
        the_permalink();
        ?>
"><?php 
        if ($img) {
            echo '<span class="thumbnail">';
            echo _get_post_thumbnail();
            echo '</span>';
        } else {
            $img = '';
        }
        ?>
<span class="text"><?php 
        the_title();
        ?>
</span><span class="muted"><?php 
        the_time('Y-m-d');
        ?>
</span><span class="muted"><?php 
        echo '评论(', comments_number('', '1', '%'), ')';
        ?>
</span></a></li>
<?php 
    }
    wp_reset_query();
}
Example #4
0
function dtheme_posts_list($orderby, $limit, $cat, $img)
{
    $args = array('order' => 'DESC', 'cat' => $cat, 'orderby' => $orderby, 'showposts' => $limit, 'category__not_in' => array(211), 'ignore_sticky_posts' => 1);
    query_posts($args);
    while (have_posts()) {
        the_post();
        ?>
<li><a<?php 
        echo _post_target_blank();
        ?>
 href="<?php 
        the_permalink();
        ?>
"><?php 
        if ($img) {
            echo '<span class="thumbnail">';
            echo _get_post_thumbnail();
            echo '</span>';
        } else {
            $img = '';
        }
        ?>
<span class="text"><?php 
        the_title();
        ?>
</span><span class="muted"><?php 
        the_time('Y-m-d');
        ?>
</span><span class="muted"><?php 
        echo '评论(', comments_number('', '1', '%'), ')';
        ?>
</span></a></li>
<?php 
    }
    wp_reset_query();
}