/ **
* Accessible share buttons
* 4 Displays social media share buttons with a link beneath the post
content on pages and posts, except for the homepage
* Works inside the loop
* Images are stored in the theme / images directory
* Rian Rietveld rrwd.nl June 2012
* @ Version 0.1 beta notes
** /

rrwd_share_buttons function ($ post_content) {
global $ post;

/ / On posts and pages, except for home, comment out if necessary
if (is_home () | | is_front_page ()) return $ post_content;

/ / Sanatize and urlencode title and permalink for inclusion in share
links
$ Share_title = sanitize_title (get_the_title ());
$ Share_title = urlencode ($ share_title);
$ Share_permalink get_permalink = ();
$ Share_permalink = urlencode ($ share_permalink);

/ / Hidden heading, for screen readers only
$ Share = "< h2  class = "rrwd-share-heading" > Share </ h2 > "" \ n ".;

$ Share = '<. ul  class = "rrwd-share-list" > "\ n".;

. $ Share = " <- Facebook -> "" \ n ";.
$ Share. = '< li > < a  href = " http://www.facebook.com/sharer.php?t =
'. $ share_title.' & u = '. $ share_permalink.' "  rel = "nofollow " > <
img  src = "'. get_bloginfo (stylesheet_directory'). '/ images /
share-facebook.png"  alt = "Share on Facebook"  class = "rrwd-share-img"
/> </ a > </ li > "" \ n ".;

. $ Share = " <- Twitter -> "" \ n ";.
$ Share. = '< li > < a  href = " http://twitter.com/share?text = '. $
share_title.' & url = '. $ share_permalink.' "  rel = "nofollow" > < img
src = "'. get_bloginfo (stylesheet_directory'). '/ images /
share-twitter.png"  alt = "Share on Twitter"  class = "rrwd-share-img"
/> </ a > </ li > '. "\ n";
. $ Share = " <- Linkedin -> "" \ n ";.
$ Share. = '< li > < a  href = "
http://www.linkedin.com/shareArticle?mini=true&url = '. get_permalink
().' & title = '. $ share_title.' "  rel = "nofollow" > < img  src = "'.
get_bloginfo (stylesheet_directory'). '/ images / share-linkedin.png"
alt = "Share on LinkedIn"  class = "rrwd-share-img"  /> </ a > </ li >
"" \ n ".;
$ Share = '. <- Google Plus -> "" \ n ";.
$ Share. = '< li > < a  href = " https://plus.google.com/share?url = '.
get_permalink ().' "  rel = "nofollow" > < img  src = "'. get_bloginfo (
'stylesheet_directory') '/ images / share-googleplus.png. "  alt =
"Share on Google+"  class = "rrwd-share-img"  /> </ a > </ li > '. "\
n";
$ Share = '</. ul > "" \ n ".;
/ / Add buttons beneath the post content
. $ Post_content = $ share;

return $ post_content;

} / / End function rrwd_share_buttons

add_filter (the_content ',' rrwd_share_buttons');