Use Facebook share link outside the WordPress loop.
It might be difficult to show Facebook share link outside the WordPress loop, since you can’t retrieve post information the usual way. To show a Facebook share link in the sidebar of single post, this snippet will be useful. This will also show how many time the url was shared on Facebook.
The last snippet is the short code ( it only works with single posts, so use conditional if statement ).
1. This is useful to show text link only, If you want to show buttons then you must use ready made script from Facebook.
2. Make sure you have page.php and single.php template otherwise it won’t work
3. To show facebook share link into the wordpress loop use this snippet By Filip Stefansson