Tagged: x
-
AuthorPosts
-
March 23, 2017 at 3:20 am #1417340
RPronkParticipantHello, yesterday I was looking in this forum and found this solutions to add social media share buttons:
Please 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”]’);
});But now they are on my whole site, I need them to be on post’s only and not on pages.
Thanks for the help!
site: http://knip-t.nlMarch 23, 2017 at 4:36 am #1417395
DarshanaModeratorHi there,
Thanks for writing in! You can use the following code instead.
// Add Social Sharing after the single post content // ============================================================================= 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');Hope that helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1417340 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
