/**
	*存档页信息
	*http://www.bgbk.org
*/
function Bing_archive_header()
{
    if (!is_archive()) {
        return;
    }
    if (is_author()) {
        $dashicons = 'admin-users';
        $name = $GLOBALS['authordata']->display_name;
        $description = get_the_author_meta('description');
        $feed_link = get_author_feed_link($GLOBALS['authordata']->ID);
    } elseif (is_date()) {
        $dashicons = 'calendar';
        if (is_day()) {
            $format = __('Y年m月d日', 'Bing');
        } elseif (is_month()) {
            $format = __('Y年m月', 'Bing');
        } else {
            $format = __('Y年', 'Bing');
        }
        $name = get_the_date($format);
        $description = sprintf(__('%s发布的文章', 'Bing'), $name);
    } else {
        $dashicons = is_tag() ? 'tag' : 'category';
        $name = single_term_title('', false);
        $description = term_description();
        $feed_link = get_term_feed_link(get_queried_object_id(), get_queried_object()->taxonomy);
    }
    $description = strip_tags($description);
    ?>
	<div class="span12 archive-header">
		<article class="panel">
			<header class="panel-header">
				<h3>
					<span class="dashicons dashicons-<?php 
    echo $dashicons;
    ?>
"></span><?php 
    echo $name;
    ?>
				</h3>
				<?php 
    if (Bing_mpanel('breadcrumbs')) {
        Bing_breadcrumbs('<span class="separator dashicons dashicons-arrow-right-alt2"></span>', '<span class="right breadcrumb"%s>', '</span>', '<span class="dashicons dashicons-admin-home"></span>' . __('首页', 'Bing'));
    }
    ?>
			</header>
			<?php 
    echo empty($description) ? __('无描述', 'Bing') : $description;
    if (!empty($feed_link)) {
        printf('<a href="%s" title="%s" class="feed-link"><span class="dashicons dashicons-rss"></span></a>', esc_url($feed_link), esc_attr(__('此存档的 Feed 源,可以使用 RSS 阅读器订阅这些内容', 'Bing')));
    }
    ?>
		</article>
	</div>
<?php 
}
示例#2
0
function Bing_user_css()
{
    $css = Bing_mpanel('custom_css');
    if (!empty($css)) {
        echo $css;
    }
    if (!Bing_mpanel('responsive')) {
        return;
    }
    foreach (array(1220, 1200, 1100, 1000, 900, 800, 700, 600, 500, 400) as $px) {
        $css = Bing_mpanel('custom_responsive_css_' . $px);
        if (!empty($css)) {
            echo '@media screen and (max-width:' . $px . 'px){' . $css . '}';
        }
    }
}
示例#3
0
/**
	*文章缩略图
	*http://www.bgbk.org
*/
function Bing_thumbnail($width, $height = null, $link = true, $url = null)
{
    if (empty($height)) {
        $height = $width;
    }
    if (empty($url)) {
        $url = Bing_post_thumbnail_url();
    }
    $title_attribute = the_title_attribute('echo=0');
    if (Bing_mpanel('timthumb')) {
        $url = Bing_timthumb($url, $width, $height);
    }
    $code = sprintf('<img src="%s" class="thumbnail" width="%s" height="%s" title="%s" alt="%s" />', esc_url($url), esc_attr($width), esc_attr($height), $title_attribute, $title_attribute);
    if ($link) {
        $code = sprintf('<a href="%s" class="thumbnail-link" rel="bookmark" title="%s">%s</a>', esc_url(get_permalink()), $title_attribute, $code);
    }
    return apply_filters('Bing_thumbnail', $code, $width, $height, $url);
}
示例#4
0
/**
	*使用移动版分类列表页
	*http://www.bgbk.org
*/
function Bing_mobile_page_about($template)
{
    if (!Bing_is_mobile_page_about()) {
        return $template;
    }
    $categories = get_categories('orderby=count&order=DESC');
    get_header();
    ?>
		<section id="container">
			<div class="row">
				<div class="span12 mobile-about">
					<article class="panel">
						<header class="panel-header">
							<h3 class="about"><span class="dashicons dashicons-info"></span><?php 
    _e('关于', 'Bing');
    ?>
</h3>
						</header>
						<p><?php 
    echo Bing_mpanel('footer_text_left');
    ?>
</p>
						<p><?php 
    echo Bing_mpanel('footer_text_right');
    ?>
</p>
					</article>
				</div>
			</div>
		</section>
<?php 
    get_footer();
    return false;
}
/**
	*自定义底部代码
	*http://www.bgbk.org
*/
function Bing_custom_footer_code()
{
    echo Bing_mpanel('footer_code');
}
示例#6
0
			</div>
			<footer id="footer">
				<div class="box-md">
					<nav class="menu footer-menu-box" role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">
						<span class="menu-title"><span class="dashicons dashicons-menu"></span><?php 
echo Bing_menu_name('footer_menu');
?>
</span>
						<?php 
wp_nav_menu(array('theme_location' => 'footer_menu', 'container' => false, 'items_wrap' => '<ul id="footer-menu">%3$s</ul>', 'fallback_cb' => 'Bing_empty_menu_fallback'));
?>
					</nav>
					<p class="footer-left"><?php 
echo Bing_mpanel('footer_text_left');
?>
</p>
					<p class="footer-right"><?php 
echo Bing_mpanel('footer_text_right');
?>
</p>
				</div>
				<?php 
Bing_mobile_menu();
?>
			</footer>
		</div>
	<?php 
wp_footer();
?>
	</body>
</html>
示例#7
0
 static function init()
 {
     if (Bing_mpanel('comment_anti') && !is_user_logged_in()) {
         new self();
     }
 }
示例#8
0
/**
	*判断 AJAX 加载页面
	*http://www.bgbk.org
*/
function Bing_is_ajax_load_page()
{
    return isset($_GET['ajax_load']) && $_GET['ajax_load'] == 'page' && Bing_mpanel('ajax_load_page') && !is_robots() && !is_feed() && !is_trackback();
}
示例#9
0
				<div class="panel">
					<header class="panel-header">
						<?php 
the_title('<h2 class="post-title">', '</h2>');
edit_post_link('<span class="dashicons dashicons-edit"></span>' . __('编辑', 'Bing'), '<span class="right">', '</span>');
?>
					</header>
					<section class="context">
						<?php 
the_content();
wp_link_pages(array('before' => '<div class="page-links">' . __('页码:', 'Bing'), 'after' => '</div>'));
?>
					</section>
					<footer class="post-meta-box"><?php 
Bing_post_meta(array('author', 'date', 'views', 'comments', 'tags'));
?>
</footer>
				</div>
			</article>
			<?php 
if (Bing_mpanel('related_posts')) {
    Bing_related_posts();
}
if (!post_password_required() && (comments_open() || get_comments_number() > 0)) {
    comments_template('', true);
}
?>
		</div>
	</section>
<?php 
get_footer();
示例#10
0
<?php

get_header();
?>
	<section id="container">
		<div class="row">
			<div class="span12 search-header">
				<article class="panel">
					<header class="panel-header">
						<h3>
							<span class="dashicons dashicons-search"></span><?php 
_e('搜索', 'Bing');
?>
						</h3>
						<?php 
if (Bing_mpanel('breadcrumbs')) {
    Bing_breadcrumbs('<span class="separator dashicons dashicons-arrow-right-alt2"></span>', '<span class="right breadcrumb"%s>', '</span>', '<span class="dashicons dashicons-admin-home"></span>' . __('首页', 'Bing'));
}
?>
					</header>
					<?php 
get_search_form();
if (get_search_query(false)) {
    echo '<p class="search-number">' . sprintf(__('关键词“%s”共有 %s 个搜索结果', 'Bing'), get_search_query(false), $GLOBALS['wp_query']->found_posts) . '</p>';
}
?>
				</article>
			</div>
			<?php 
if (get_search_query(false)) {
    Bing_posts_list();