/** * Get the page title * @return string */ function app_get_page_title() { // check if yoast is set $yoast_isset = check_if_seo_plugin_installed(); if ($yoast_isset) { return get_the_title(); } else { return join(' | ', array_filter(array(wp_title(null, false), get_bloginfo('name')), 'strlen')); } }
<html class="no-js" <?php language_attributes(); ?> > <head> <meta charset="<?php bloginfo('charset'); ?> "> <title><?php app_get_page_title(); ?> </title> <?php if (check_if_seo_plugin_installed() === false) { ?> <?php include dirname(__FILE__) . '/incl-open-graph-meta.php'; ?> <?php } ?> <?php include __DIR__ . '/incl-open-graph-meta.php'; ?> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>