Skip to content

Instantly share code, notes, and snippets.

@samuelsimoes
Created July 18, 2012 14:33
Show Gist options
  • Save samuelsimoes/3136540 to your computer and use it in GitHub Desktop.
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
<?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