示例#1
0
function body_class()
{
    $classes = array();
    //  Get the URL slug
    $parts = explode('/', Uri::current());
    $classes[] = count($parts) ? trim(current($parts)) : 'index';
    //  Is it a posts page?
    if (is_postspage()) {
        $classes[] = 'posts';
    }
    //  Is it the homepage?
    if (is_homepage()) {
        $classes[] = 'home';
    }
    return implode(' ', array_unique($classes));
}
示例#2
0
function body_class()
{
    $classes = array();
    //  Is it a posts page?
    if (is_postspage()) {
        $classes[] = 'posts';
    }
    //  Is it the homepage?
    if (is_homepage()) {
        $classes[] = 'home';
    }
    //  Is it a single post?
    if (is_article()) {
        $classes[] = 'article';
    }
    //  Is it a custom page?
    if (is_page()) {
        $classes[] = 'page';
    }
    return implode(' ', array_unique($classes));
}
<!doctype html>
<html class="no-js" lang="en">
	<head>
		<meta charset="utf-8">

		<?php 
$title = site_name();
$prefix = is_homepage() ? '' : page_title('Page can’t be found') . ' - ';
?>
		<title><?php 
echo $prefix . $title;
?>
</title>

		<meta name="description" content="<?php 
echo site_description();
?>
">
		<link rel="stylesheet" href="<?php 
echo theme_url('/css/styles.css');
?>
">

		<!-- Special CSS for individual articles -->
		<?php 
if (customised()) {
    ?>
    		<style><?php 
    echo article_css();
    ?>
</style>
示例#4
0
echo site_description();
?>
">
        <?php 
if (is_article()) {
    ?>
            <meta name="og:description" content="<?php 
    echo article_description();
    ?>
">
            <meta name="description" content="<?php 
    echo article_description();
    ?>
">
        <?php 
} elseif (is_homepage()) {
    ?>
            <meta name="og:description" content="<?php 
    echo site_description();
    ?>
">
            <meta name="description" content="<?php 
    echo site_description();
    ?>
">
        <?php 
} elseif (is_page()) {
    ?>
            <meta name="og:description" content="<?php 
    echo site_description();
    ?>
示例#5
0
文件: doozer.php 项目: gruner/doozer
/**
 * Creates the title tag for the page.
 *
 * Uses $_title variable for the text but defaults to the value defined in config.php
 *
 * Parameters:
 *   $separator - the string that separates title elements
 *
 * @return Formatted title tag
 */
function title_tag($separator = '-')
{
    global $_name, $_title, $_headline, $config;
    $page_name = use_default($_headline, $_name);
    $base_title = use_default($_title, $config['page_title']);
    $title = is_homepage() ? $base_title : "{$page_name} {$separator} {$base_title}";
    # remove special chars from page name
    return content_tag('title', sanitize_title_text($title));
}