Advertisement
pixedelic

Sharedaddy workaround

Feb 11th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. add_action( 'loop_start', 'pix_remove_sharedaddy' );
  2. add_action( 'the_content', 'pix_append_sharedaddy' );
  3.  
  4. function pix_remove_sharedaddy() {
  5.     remove_filter( 'the_content', 'sharing_display',19 );
  6.     if ( class_exists( 'Jetpack_Likes' ) ) {
  7.         remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
  8.     }
  9. }
  10.  
  11. function pix_append_sharedaddy($content) {
  12.     if ( function_exists( 'sharing_display' ) ) {
  13.         $content .= sharing_display( '', false );
  14.     }
  15.  
  16.     if ( class_exists( 'Jetpack_Likes' ) ) {
  17.         $custom_likes = new Jetpack_Likes;
  18.         $content .= $custom_likes->post_likes( '' );
  19.     }
  20.  
  21.     return $content;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement