Skip to content

Instantly share code, notes, and snippets.

@RyanNutt
Last active July 31, 2017 01:58
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 RyanNutt/5936886e7f279a856a6d5bb74ef16800 to your computer and use it in GitHub Desktop.
Save RyanNutt/5936886e7f279a856a6d5bb74ef16800 to your computer and use it in GitHub Desktop.
Sample code for post on how to hide WordPress titles - https://www.nutt.net/hide-post-titles-wordpress/
.postid-123 .page-title {
display: none;
}
add_action( 'wp_head', 'hide_title' );
function hide_title() {
if (is_single()) {
if (metadata_exists( $post->post_type, $post->ID, 'hide_title')) {
echo '<style type="text/css">.page-title {display:none;}</style>';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment