Ejemplo n.º 1
0
 * ===
 * This first section creates our meta tag values
 * ===
 *
 */
$meta = array();
/**
 * Title
 */
$meta['title'] = false;
// On the homepage use the site name
if (is_home()) {
    $meta['title'] = trim(get_bloginfo('name'));
} else {
    // Otherwise, use the document title
    $meta['title'] = trim(d7_get_document_title());
}
/**
 * Site name
 */
$meta['site_name'] = get_bloginfo('name');
/**
 * URL
 */
$meta['url'] = empty($_SERVER['HTTPS']) ? 'http' : 'https';
$meta['url'] .= '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
/**
 * Description
 */
$meta['description'] = false;
// For singles and pages, use the post body
Ejemplo n.º 2
0
/**
 * Print the document title, used in the title tag and og:title.
 *
 * ### Usage
 * ```php
 * <title><?php document_title(); ?></title>
 * ```
 * @package d7
 * @subpackage boilerplate-theme
 *
 * @uses d7_get_document_title()
 * @link https://codex.wordpress.org/Function_Reference/wp_title WordPress's wp_title() function
 *
 */
function d7_document_title()
{
    echo d7_get_document_title();
}