#Add Social Share Buttons to Posts Without JS
This snippit is for manualy creating social share buttons, particulerly for use within the entry footer of the Genesis Framework. The hope was to build a simple, customizable and lightweight social share buttons that would meet my needs without adding a lot of file size or unecessary js/jquery files. For icons I am using FontAwsome via icomoon, see the class markup.
In order to make the Pinterest share button work I need to grab the link to the first image in the post. Their might be a better way to do this but it was the best solution I could find at the time. This is the first function to run and then is passed to the second function via .pb_find_image_url(). If your not using Pinterest you can remove this function.
I set this file up as a seprate php file in my child theme's 'include' folder and call it up in the 'single.php' file
- Find the first image in the post:
- function pb_find_image_url()
- Add Social share icons
- function pb_social_share()
#Refrance:
Notes: