Tagged: x
-
AuthorPosts
-
June 30, 2016 at 9:43 am #1066758
jfhdcParticipantHello,
I’m trying to figure out how to have the custom social sharing icons appear at the bottom of all our blog posts. I’ve figured out how to use the short code, but ideally my authors wouldn’t have to manually enter this every time they post.
Is there a way to turn this on without creating a child theme? I feel like this must be a simple option somewhere that I’m just missing, but haven’t had any luck finding it.
Thank you!
June 30, 2016 at 11:48 am #1066940
RahulModeratorHi There,
Thanks for writing in.
You can add this code at your child theme’s functions.php to apply sharing for each single post page.
add_filter('the_content', 'x_add_social_sharing', 9999); function x_add_social_sharing ( $content ) { return is_singular('post') ? $content.do_shortcode('[share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]') : $content; }Hope this helps.
June 30, 2016 at 11:50 am #1066942
Prasant RaiModeratorHello There,
Thanks for writing in1
Implementing social sharing in blog posts will requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.
After that kindly add the code below in your functions.php.
add_action('x_before_the_content_end', function() { echo do_shortcode('[share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]'); });Hope that helps and kindly Let us know how this goes!
Thanks.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1066758 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
