Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Created September 17, 2012 21:08
Show Gist options
  • Select an option

  • Save wpsmith/3739788 to your computer and use it in GitHub Desktop.

Select an option

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)
<?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