Created
September 17, 2012 21:08
-
-
Save wpsmith/3739788 to your computer and use it in GitHub Desktop.
How to split out Visual Subtitle into its own Genesis Hook (genesis_after_post_title)
This file contains hidden or 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
| <?php | |
| // Remove Visual_Subtitle filter | |
| remove_filter( 'the_title', array( Visual_Subtitle::$instance, 'filter' ) ); | |
| add_action( 'genesis_after_post_title', 'wps_subtitle' ); | |
| /** | |
| * Adds the subtitle to genesis_after_post_title. | |
| * No need to rebuild admin portion since WP doesn't recognize it anyways. | |
| */ | |
| function wps_subtitle() { | |
| global $post; | |
| $subtitle = get_post_meta( $post->ID, '_visual-subtitle', true ); | |
| if ( ! $subtitle ) return $title; | |
| if ( class_exists( 'Visual_Subtitle' ) ) | |
| echo '<span class="subtitle test">' . $subtitle . '</span>'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment