Skip to content

Instantly share code, notes, and snippets.

@keeev
Created November 11, 2013 13:08
Show Gist options
  • Save keeev/7412937 to your computer and use it in GitHub Desktop.
Save keeev/7412937 to your computer and use it in GitHub Desktop.
this is the setting of the actual header.php
<?php
$seo_title = get_post_meta($post->ID, '_yoast_wpseo_title', true);
$seo_title = apply_filters('the_title', $seo_title);
if($seo_title == "") $seo_title = get_the_title();
?>
<title><?php if (!is_home()) { echo $seo_title; echo " - "; } echo str_replace("%s", "", get_bloginfo('name')); ?><?php # if (!is_home())
echo " ";
#get_the_title();#wp_title(); ?></title>
@javorszky
Copy link

Yoast's SEO hooks into the wp_title() function, so all you really need is this:
<title><?php wp_title(); ?></title> as per http://yoast.com/wordpress-seo-plugin-theme-integration-guide/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment