Created
July 18, 2012 14:33
-
-
Save samuelsimoes/3136540 to your computer and use it in GitHub Desktop.
Função mais apropriada para colocar no lugar do the_title no <title> do header.php no Wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function custom_theme_title($separador=null, $sufixo=null){ | |
global $post; | |
$title = ""; | |
if(is_post_type_archive()) $title .= post_type_archive_title(null, false); | |
else if(is_page()) $title .= get_the_title($post_id); | |
else if(is_home()) $title .= 'Blog'; | |
$title .= $separador . $sufixo; | |
echo $title; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment