I'm trying to change the title in browser tab for a child theme of twentytwelve. I wan't it to print out the same title on every page. What the heck is happening?
<?php
function im_awesome_title($title){
$title = "Im awesome!";
return $title;
}
add_filter( 'wp_title', 'im_awesome_title', 20 );
or some like this. script better put in the end of all php tags
<?php
//set title
echo "<script>setTimeout(function(){var tts = document.getElementsByTagName(\"title\");if(tts.length > 0)tts[0].innerHTML=\"My title\"; else {var tt0 = document.createElement(\"TITLE\"); tt0.innerHTML = \"My title\"; document.head.appendChild(tt0);}}, 200);</script>";
?>