Skip to content

Instantly share code, notes, and snippets.

@facelordgists
Created June 12, 2013 21:21
Show Gist options
  • Save facelordgists/5769239 to your computer and use it in GitHub Desktop.
Save facelordgists/5769239 to your computer and use it in GitHub Desktop.
WORDPRESS: Filter Hybrid Entry Titles
<?
// Filter Hybrid Entry Titles
add_filter( 'hybrid_entry_title', 'remove_links_from_headings' );
function remove_links_from_headings($title){
if ( is_single()) {
// display H1 tag on single blog posts using the following markup
return '<h1 class="page-title entry-title">' . get_the_title() . '</h1>';
} elseif( is_front_page() || is_page() ){
// destroy H1 tag on static home page and all single pages
return '';
} else {
// otherwise use default markup
return $title;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment