Пример #1
0
/**
	*主文章列表样式
	*http://www.bgbk.org
*/
function Bing_posts_list_loop()
{
    $thumbnail_class = Bing_mpanel('thumbnail') ? 'thumbnail' : '';
    ?>
	<li <?php 
    post_class(array('span12', $thumbnail_class));
    ?>
>
		<article class="panel">
			<header class="panel-header">
				<?php 
    the_title('<h3 class="post-title"><a href="' . esc_url(get_permalink()) . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h3>');
    ?>
			</header>
			<?php 
    if (Bing_mpanel('thumbnail')) {
        echo Bing_thumbnail(170, 120);
    }
    ?>
			<div class="right-box">
				<p class="excerpt"><?php 
    echo Bing_excerpt(230);
    ?>
</p>
				<?php 
    Bing_post_meta();
    ?>
			</div>
		</article>
	</li>
<?php 
}
/**
	*获取网页描述
	*http://www.bgbk.org
*/
function Bing_site_description($home)
{
    if (is_home() || is_front_page()) {
        $description = $home;
    } elseif (is_category() || is_tag() || is_tax()) {
        $description = term_description();
    } elseif (is_singular()) {
        $description = Bing_excerpt(260);
    } elseif (is_author()) {
        $description = get_the_author_meta('description');
    } elseif (is_date()) {
        if (is_day()) {
            $d = __('Y年m月d日', 'Bing');
        } elseif (is_month()) {
            $d = __('Y年m月', 'Bing');
        } else {
            $d = __('Y年', 'Bing');
        }
        $description = sprintf(__('%s发布的文章', 'Bing'), get_the_date($d));
    } else {
        return '';
    }
    $description = strip_tags(trim($description));
    return str_replace(PHP_EOL, '', $description);
}
Пример #3
0
/**
	*相关文章样式
	*http://www.bgbk.org
*/
function Bing_related_posts_loop()
{
    ?>
	<li <?php 
    post_class('span4');
    ?>
>
		<div class="panel no-padding">
			<a href="<?php 
    the_permalink();
    ?>
" class="thumbnail-link" rel="bookmark" title="<?php 
    the_title_attribute();
    ?>
">
				<?php 
    echo Bing_thumbnail(175, 80, false);
    ?>
				<div class="excerpt"><?php 
    echo Bing_excerpt(80);
    ?>
</div>
			</a>
			<div class="bottom-box">
				<?php 
    the_title('<h4 class="post-title"><a href="' . esc_url(get_permalink()) . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h4>');
    Bing_post_meta(array('author', 'date-abb'));
    ?>
			</div>
		</div>
	</li>
<?php 
}