Social Sharing Function Not Working

I’m trying to add social media sharing icons on individual blog post (Would prefer on top of each blog post. Social Share plug-in did not work, received warning: icons would not work without adding additional code) and used this code from the forum (Minus the " "):

“function x_add_social_sharing ( $content ) {
if ( is_singular(‘post’) ) {
echo do_shortcode(’[x_share title=“Share this Post” facebook=“true” twitter=“true” google_plus=“true” linkedin=“true” pinterest=“true” reddit=“true” email=“true”]’);
}
}”

add_action(‘x_before_the_content_end’, ‘x_add_social_sharing’);

Looking at my site this does not work but just shows the test. Please see images.

FYI- I have removed this code after posting this on the forum so the site will look normal. But please help.

Problem solved with Social Warfare Plugin

Hey Troy,

The code you tried to place in the functions.php did not work as expected because you have inserted it in the incorrect place here it mixed up with the JS code which is treated as a normal text instead of an actual code.

You will have to place it at the end of the file after : <?php }

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.