Skip to content

Instantly share code, notes, and snippets.

@wpspeak
Forked from GaryJones/functions.php
Created September 11, 2013 11:02
Show Gist options
  • Save wpspeak/6522095 to your computer and use it in GitHub Desktop.
Save wpspeak/6522095 to your computer and use it in GitHub Desktop.
<?php
add_action( 'pre_get_posts', 'mfsbig_remove_floating_social_bar', 15 );
/**
* Remove Floating Social Bar from outputting at the top of the content.
*
* FSB adds these filters at pre_get_posts, priorty 10, so we'll remove them
* just after that.
*
* @author Gary Jones
* @link http://gamajo.com/move-floating-social-bar
*/
function mfsbig_remove_floating_social_bar() {
if ( class_exists( 'floating_social_bar' ) ) {
remove_filter( 'the_excerpt', array( floating_social_bar::get_instance(), 'fsb' ), apply_filters( 'fsb_social_bar_priority', 10 ) );
remove_filter( 'the_content', array( floating_social_bar::get_instance(), 'fsb' ), apply_filters( 'fsb_social_bar_priority', 10 ) );
}
}
add_action( 'genesis_before_entry_content', 'mfsbig_add_floating_social_bar' );
/**
* Echo the Floating Social Bar in the right place, just before the entry
* content (after the header and entry meta) in Genesis child themes.
*
* As fsb() is really a function for filtering, it requires a single argument
* (the content or excerpt), so we fool it by passing in an empty string instead.
*
* @author Gary Jones
* @link http://gamajo.com/move-floating-social-bar
*/
function mfsbig_add_floating_social_bar() {
if ( class_exists( 'floating_social_bar' ) ) {
echo floating_social_bar::get_instance()->fsb('');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment