Skip to content

Instantly share code, notes, and snippets.

@ronalfy
Created May 11, 2016 20:14
Show Gist options
  • Save ronalfy/61a96e2d22d4d7ce9690228ec42af277 to your computer and use it in GitHub Desktop.
Save ronalfy/61a96e2d22d4d7ce9690228ec42af277 to your computer and use it in GitHub Desktop.
Custom H1 for Advanced Custom Fields
<?php
function fichte_custom_title( $post_id ) {
$title = get_field( 'custom_h1', $post_id );
if ( false == $title || empty( $title ) ) {
echo esc_html( get_the_title( $post_id ) );
} else {
echo esc_html( $title );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment