Changing Share Plugin & Builder Priority

Themify Builder appends its content filtering the post or page content using the_content filter and appending itself. Share plugins like AddThis, ShareThis, Bookmarkify, etc. also use the same method to append content to the post or page. Sometimes they might have conflicts due to their display priority.

Priority is a term used in WordPress actions and filters, and it indicates the order in which the action or filter is executed. Priority goes from 0 to anything. In our particular case with Builder and share plugins, priority will be the order in which these additional contents are appended.

As a reference, Builder appends its content on priority 11, so to add content after Builder's own content, you must use priority 12 or higher.

This tutorial provides sample custom functions to show you how to change the priority of the social buttons so they are added after Builder.

  • create a custom-functions.php file in the theme folder (if it doesn't exist)
  • paste in the following function:

SimpleShareButtons

Reference: http://www.simplesharebuttons.com/wordpress/


<?php
// change priority for SimpleShareButtons
if ( function_exists( 'show_share_buttons' ) ) {
remove_filter( 'the_content', 'show_share_buttons');
add_filter( 'the_content', 'show_share_buttons', 15 );
}
?>

JetPack Sharedaddy

Reference: http://jetpack.me/tag/sharedaddy/


<?php
// Change priority for Shareaholic 
remove_filter( 'the_content', 'sharing_display', 19 );
	remove_filter( 'the_excerpt', 'sharing_display', 19 );
	add_filter( 'the_content', 'sharing_display', 10 );
	add_filter( 'the_excerpt', 'sharing_display', 10 );
?>

Themify 7.5 has released! Please read the update notes.