Created
June 4, 2014 20:24
-
-
Save robneu/df279c2226f56f04f50a to your computer and use it in GitHub Desktop.
Move the podcast player to another location in Genesis when using the Seriously Simple Podcasting plugin.
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
<?php | |
add_action( 'genesis_before_content', 'prefix_move_podcast_player' ); | |
/** | |
* Remove the podcast meta filter on the_content. | |
* | |
* By default, the Seriously Simple Podcasting plugin will display the media | |
* player and other file info within the content. This doesn't allow for much | |
* flexibility with the placement, so this removes the filter and hooks a | |
* function to display the podcast meta elswhere in the markup. | |
* | |
* @global ss_podcasting | |
* @since 2.0.0 | |
*/ | |
function prefix_move_podcast_player() { | |
global $ss_podcasting; | |
remove_filter( 'the_content', array( $ss_podcasting, 'content_meta_data') ); | |
add_action( 'genesis_entry_header', 'prefix_podcast_meta', 15 ); | |
} | |
/** | |
* Display the podcast meta if it exists. | |
* | |
* @global ss_podcasting | |
* @since 2.0.0 | |
*/ | |
function prefix_podcast_meta() { | |
global $ss_podcasting; | |
// Do nothing if we have no audio file. | |
$podcast_meta = $ss_podcasting->content_meta_data( $content = '' ); | |
if ( empty( $podcast_meta ) ) { | |
return; | |
} | |
// Display the meta. | |
echo $podcast_meta; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment