Skip to content

Instantly share code, notes, and snippets.

@scottnix
Created April 5, 2013 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottnix/5321495 to your computer and use it in GitHub Desktop.
Save scottnix/5321495 to your computer and use it in GitHub Desktop.
Thematic Remove Permalink from Title Filter
// remove the damn "Permalink to..." that appears on the titles, it is debatable this is bad for SEO's internal linking.
function childtheme_postheader_posttitle($posttitle ) {
$posttitle = "\n\n\t\t\t\t\t";
if (is_single() || is_page()) {
$posttitle .= '<h1 class="entry-title">' . get_the_title() . "</h1>\n";
} elseif (is_404()) {
$posttitle .= '<h1 class="entry-title">' . __('Not Found', 'thematic') . "</h1>\n";
} else {
$posttitle .= '<h2 class="entry-title">';
$posttitle .= sprintf('<a href="%s" title="%s" rel="bookmark">%s</a>',
apply_filters('the_permalink', get_permalink()),
sprintf( esc_attr__('%s', 'thematic'), the_title_attribute( 'echo=0' ) ),
get_the_title());
$posttitle .= "</h2>\n";
}
return $posttitle;
}
add_filter('thematic_postheader_posttitle', 'childtheme_postheader_posttitle');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment