Skip to content

Instantly share code, notes, and snippets.

@halgatewood
Created June 15, 2013 03:19
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 halgatewood/5786742 to your computer and use it in GitHub Desktop.
Save halgatewood/5786742 to your computer and use it in GitHub Desktop.
WP Check for H1 Custom Field value.
// H1 SUPPORT
function hg_check_for_h1_title($title, $id)
{
if (in_the_loop() AND $id == get_the_ID())
{
$h1 = get_post_meta($id, 'h1', true);
if($h1) return $h1;
}
return $title;
}
add_filter('the_title', 'hg_check_for_h1_title', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment