コード例 #1
0
ファイル: excerpt.php プロジェクト: yszar/linuxwp
<?php

/**
 * Used for index/archive/search/author/catgory/tag.
 *
 */
$ii = 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')) {
コード例 #2
0
ファイル: widget-posts.php プロジェクト: zce/wp-theme-wedn
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();
}
コード例 #3
0
ファイル: widget-sticky.php プロジェクト: zce/wp-theme-wedn
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();
}
コード例 #4
0
ファイル: user.php プロジェクト: zce/wp-theme-wedn
function u_get_thumbnail_src()
{
    global $post;
    $content = _get_post_thumbnail();
    preg_match_all('/<img.*?(?: |\\t|\\r|\\n)?src=[\'"]?(.+?)[\'"]?(?:(?: |\\t|\\r|\\n)+.*?)?>/sim', $content, $strResult, PREG_PATTERN_ORDER);
    return $strResult[1][0];
}