Hi, I was wondering how you add social media share icons to the blog page - to each individual post? I can’t see anywhere in any settings to add them - am I missing where the secret button is to turn them on?!!
Thanks!
Hi, I was wondering how you add social media share icons to the blog page - to each individual post? I can’t see anywhere in any settings to add them - am I missing where the secret button is to turn them on?!!
Thanks!
Hey,
You need to add this shortcode for each post: http://demo.theme.co/integrity-1/shortcodes/entry-share/
Hi John
Thanks for getting back to me, but isn’t there something that adds it to the bottom of each post automatically as my client will be adding in posts themselves and it’s not that great expecting them to remember to insert the shortcode each time! I would have thought this would have been a standard feature!
Thanks!
Hi There,
Please add the following code under functions.php
file locates in your child theme:
function x_add_social_sharing() {
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');
Hi that’s great, thanks for your help!
You’re welcome.
Hi, I’ve just noticed that they appear at the very bottom of all the pages! Do you know how they can just be applied to the blog articles?
Thanks!
Hello @core365,
Sorry for the confusion. All we need to do is to wrap the code inside a conditional statement that will display social icons on single blog post. Please add following code in child theme function.php:
function x_add_social_sharing ( $content ) {
if ( is_singular('post') ) {
echo do_shortcode('[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');
If you would like to learn more about single post conditional tags, please refer following article:
https://codex.wordpress.org/Function_Reference/is_singular
Thanks.
Hi, that’s great, you sorted it, thanks!
On behalf of my colleague, you’re welcome. Cheers!