Exemple #1
0
function time_ago($type = 'commennt', $day = 30)
{
    $d = $type == 'post' ? 'get_post_time' : 'get_comment_time';
    $timediff = time() - $d('U');
    if ($timediff <= 60 * 60 * 24 * $day) {
        echo human_time_diff($d('U'), strtotime(current_time('mysql', 0))), '前';
    }
    if ($timediff > 60 * 60 * 24 * $day) {
        if (lo_opt('time_style') == '1') {
            echo date('Y-m-d', get_comment_date('U')), ' ', get_comment_time('H:i');
        } elseif (lo_opt('time_style') == '2') {
            echo date('Y/m/d', get_comment_date('U')), ' ', get_comment_time('H:i');
        } elseif (lo_opt('time_style') == '3') {
            echo date('d-m-Y', get_comment_date('U')), ' ', get_comment_time('H:i');
        } else {
            echo date('d/m/Y', get_comment_date('U')), ' ', get_comment_time('H:i');
        }
    }
}
Exemple #2
0
/**
 * sns
 *
 * @since 1.0
 *
 */
function sns()
{
    if (lo_opt('sns_github')) {
        echo '<a class="github" href ="' . lo_opt('sns_github') . '" target="_blank"><i class="iconfont icon-github"></i></a>';
    }
    if (lo_opt('sns_weibo')) {
        echo '<a class="weibo" href ="' . lo_opt('sns_weibo') . '" target="_blank"><i class="iconfont icon-weibo"></i></a>';
    }
    if (lo_opt('sns_twitter')) {
        echo '<a class="twitter" href ="' . lo_opt('sns_twitter') . '" target="_blank"><i class="iconfont icon-twitter"></i></a>';
    }
    if (lo_opt('sns_linkedin')) {
        echo '<a class="linkedin" href ="' . lo_opt('sns_linkedin') . '" target="_blank"><i class="iconfont icon-0457linkedin"></i></a>';
    }
    if (lo_opt('sns_google')) {
        echo '<a class="google" href ="' . lo_opt('sns_google') . '" target="_blank"><i class="iconfont icon-googleplus3"></i></a>';
    }
    if (lo_opt('sns_rss')) {
        echo '<a class="rss" href ="' . get_bloginfo('url') . '/feed" target="_blank"><i class="iconfont icon-rss"></i></a>';
    }
}
Exemple #3
0
    </header>
	<div class="post-meta">
		<ul>
			<li><?php 
the_category(',');
?>
</li>
			<li><time datetime="<?php 
echo esc_attr(get_the_date('c'));
?>
" itemprop="datePublished" pubdate><?php 
if (lo_opt('time_style') == '1') {
    the_time('Y-m-d');
} elseif (lo_opt('time_style') == '2') {
    the_time('Y/m/d');
} elseif (lo_opt('time_style') == '3') {
    the_time('d-m-Y');
} else {
    the_time('d/m/Y');
}
?>
</time></li>
			<li><?php 
lo_post_views(' ' . __('Views', 'Lophita'));
?>
</li>
		</ul>
	</div>
    <div class="post-content clearfix" itemprop="description">
		<?php 
$pc = $post->post_content;
Exemple #4
0
 * @license MIT
 * @since 1.0
 * @version 1.0
 */
?>
		</div>

		<footer id="footer" <?php 
if (lo_opt('index_bg')) {
    echo 'style="background-image: url(\'' . lo_opt('index_bg') . '\');"';
}
?>
role="contentinfo" itemscope itemtype="http://schema.org/WPFooter">
			<div class="footer-wrap">
				<div class="information"><p><?php 
echo lo_opt('footer_info');
?>
</p></div>
				<?php 
do_action('footer_copyright');
?>
			</div>
		</footer>
	</div>
	<a id="gotop" href="javascript:;" class="iconfont icon-up"></a>

<?php 
wp_footer();
?>
</body>
</html>
Exemple #5
0
            }
        }
    }
}
?>
</title>
	<?php 
wp_head();
?>

<?php 
if (lo_opt('header_js') != '') {
    echo '<script>' . lo_opt('header_js') . '</script>';
}
if (lo_opt('custom_style') != '') {
    echo '<style>' . lo_opt('custom_style') . '</style>';
}
?>
</head>
<body>
	<div class="loading-bar"></div>
	<div id="wrap">
		<div id="header" class="standard">
			<div class="header-wrap layout-center">
				<h1 class="site-title"><a href="<?php 
bloginfo('url');
?>
"><?php 
bloginfo('name');
?>
</a></h1>
Exemple #6
0
	<?php 
wp_head();
?>
</head>
<body <?php 
lo_body_class();
?>
 >
	<div class="loading-bar"></div>
	<div id="wrap" <?php 
lo_wrap_class();
?>
 >
		<div id="header" class="standard" <?php 
if (lo_opt('index_bg')) {
    echo 'style="background-image: url(\'' . lo_opt('index_bg') . '\');"';
}
?>
>
			<div class="header-wrap layout-center">
				<h1 class="site-title"><a href="<?php 
bloginfo('url');
?>
"><?php 
bloginfo('name');
?>
</a></h1>
				<div id="header-menu">
					<i class="iconfont icon-liebiao"></i>
					<?php 
if (function_exists('wp_nav_menu')) {
Exemple #7
0
/**
 * get author avatar
 *
 * @since 1.1
 */
function author_avatar($size = 90)
{
    $avatar = lo_opt('author_avatar');
    if ($avatar) {
        echo '<img width="' . $size . '" height="' . $size . '" class="avatar avatar-' . $size . '" src="' . $avatar . '">';
    } else {
        echo get_avatar(get_the_author_meta('email'), $size, '');
    }
}
Exemple #8
0
    return false;
}
remove_filter('comment_text', 'wpautop');
add_filter('pre_option_link_manager_enabled', '__return_true');
remove_filter('the_content', 'wpautop');
add_filter('the_content', 'wpautop', 12);
function no_self_ping(&$links)
{
    $home = get_option('home');
    foreach ($links as $l => $link) {
        if (0 === strpos($link, $home)) {
            unset($links[$l]);
        }
    }
}
if (lo_opt('nopingback')) {
    add_action('pre_ping', 'no_self_ping');
}
/**
* Disable the emoji's
*/
function disable_emojis()
{
    remove_action('wp_head', 'print_emoji_detection_script', 7);
    remove_action('admin_print_scripts', 'print_emoji_detection_script');
    remove_action('wp_print_styles', 'print_emoji_styles');
    remove_action('admin_print_styles', 'print_emoji_styles');
    remove_filter('the_content_feed', 'wp_staticize_emoji');
    remove_filter('comment_text_rss', 'wp_staticize_emoji');
    remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
    add_filter('tiny_mce_plugins', 'disable_emojis_tinymce');
Exemple #9
0
 * @author Javis <*****@*****.**>
 * @license MIT
 * @since 1.0
 * @version 1.0
 */
?>
	</div>

	<footer id="footer" role="contentinfo" itemscope itemtype="http://schema.org/WPFooter">
		<div class="footer-wrap">
			<div class="footer-info"><p><?php 
echo lo_opt('footer_info');
?>
</p></div>
			<div class="footer-wp"><p>Proudly powered by <a href="https://wordpress.org/" target="_blank">WordPress</a> · Theme by <a href="http://lostg.com" target="_blank">Javis</a></p></div>
		</div>
	</footer>
</div>
<!--<a id="gotop" href="javascript:;" class="iconfont icon-up"></a>
<div id="full-overlay"></div>-->
<?php 
wp_footer();
if (lo_opt('footer_js') != '') {
    echo '<script>' . lo_opt('footer_js') . '</script>';
}
if (lo_opt('tongji_js') != '') {
    echo '<script>' . lo_opt('tongji_js') . '</script>';
}
?>
</body>
</html>
Exemple #10
-1
function lo_description()
{
    global $s, $post;
    $description = '';
    $blog_name = get_bloginfo('name');
    if (is_singular()) {
        $ID = $post->ID;
        $title = $post->post_title;
        $author = $post->post_author;
        $user_info = get_userdata($author);
        $post_author = $user_info->display_name;
        if (!get_post_meta($ID, "meta-description", true)) {
            $description = $title . ' - 作者: ' . $post_author . ',首发于' . $blog_name;
        } else {
            $description = get_post_meta($ID, "meta-description", true);
        }
    } elseif (is_home()) {
        $description = lo_opt('index_description');
    } elseif (is_tag()) {
        $description = single_tag_title('', false) . " - " . trim(strip_tags(tag_description()));
    } elseif (is_category()) {
        $description = single_cat_title('', false) . " - " . trim(strip_tags(category_description()));
    } elseif (is_archive()) {
        $description = $blog_name . "'" . trim(wp_title('', false)) . "'";
    } elseif (is_search()) {
        $description = $blog_name . ": '" . esc_html($s, 1) . "' 的搜索結果";
    } else {
        $description = $blog_name . "'" . trim(wp_title('', false)) . "'";
    }
    $description = mb_substr($description, 0, 220, 'utf-8');
    echo "<meta name=\"description\" content=\"{$description}\">\n";
}