Last active
July 31, 2017 01:58
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.postid-123 .page-title { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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