How would one move the sharedaddy buttons included in Jetpack to be placed before a post’s or page’s content, rather than after it? I see that in sharing-service.php
the function that prints the buttons is hooked to the_content filter hook: add_filter( 'the_content', 'sharing_display', 19 );
I’m not sure what to place in my functions.php file to override that, though. I’m assuming I somehow need to cause the output from sharing-service.php
to be prepended to the_content
rather than appended to it.
Basically it line 480 in sharing-service.php
where it says:
and it should be
now changing that file won’t keep your changes on updates so you can copy that function (sharing_display) to your functions.php and rename it to something different say
my_sharing_display
and make the change there.Next you need to remove the filters that plugin adds and replace with your own so in your functions.php add:
Update
the remove_filter hook is not actually removing because it’s missing the priority parameter , from the codex:
so change :
to:
try this:
worked for me
Another option, would be to edit the Jetpack plugin files directly. Take out both
add_filters()
forthe_content
andthe_excerpt
from sharing-service.php.Then you can manually put
<?php echo sharing_display(); ?>
in your theme’s loop wherever you want the sharing bar to be located.