Ejemplo n.º 1
0
    if (has_post_thumbnail() || !dopt('d_thumbnail_b')) {
        $_thumbnail = true;
    }
    ?>
<article class="excerpt<?php 
    echo !$_thumbnail ? ' excerpt-nothumbnail' : '';
    ?>
">
	<?php 
    if ($_thumbnail) {
        ?>
	<div class="focus"><a href="<?php 
        the_permalink();
        ?>
" class="thumbnail"><?php 
        deel_thumbnail();
        ?>
</a></div>
	<?php 
    }
    ?>
	<header>
		<?php 
    if (!is_category()) {
        $category = get_the_category();
        if ($category[0]) {
            echo '<a class="label label-important" href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '<i class="label-arrow"></i></a>';
        }
    }
    ?>
		<h2><a href="<?php 
Ejemplo n.º 2
0
function dtheme_posts_list($orderby, $limit, $cat, $img)
{
    $args = array('order' => DESC, 'cat' => $cat, 'orderby' => $orderby, 'showposts' => $limit, 'caller_get_posts' => 1);
    query_posts($args);
    while (have_posts()) {
        the_post();
        ?>
<li><a href="<?php 
        the_permalink();
        ?>
"><?php 
        if ($img) {
            echo '<span class="thumbnail">';
            echo deel_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 
        comments_number('', '1评论', '%评论');
        ?>
</span></a></li>
<?php 
    }
    wp_reset_query();
}
Ejemplo n.º 3
0
<div class="sticky">
	<h2 class="title">置顶推荐</h2>
	<ul>
	<?php 
$sticky = get_option('sticky_posts');
rsort($sticky);
query_posts(array('post__in' => $sticky, 'caller_get_posts' => 1, 'showposts' => dopt('d_sticky_count') ? dopt('d_sticky_count') : 2));
while (have_posts()) {
    the_post();
    echo '<li class="item"><a href="' . get_permalink() . '">';
    echo deel_thumbnail();
    echo '<h3>' . get_the_title() . '</h3><p class="muted">' . deel_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 48, '...') . '</p>';
    echo '</a></li>';
}
wp_reset_query();
?>
	</ul>
</div>