public
Created

Thematic Remove Permalink from Title Filter

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// 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');

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.