Tagged: x
-
AuthorPosts
-
April 7, 2016 at 3:34 pm #871859
ProductionMD1986ParticipantHi, I wanted to see social share buttons in all my posts, so I’ve added this code in my functions.php (in my child theme of course):
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”]’);
});It worked, but now, the social share buttons appear in all the pages, not only in my posts. How can I fix it so I see this buttons only in my posts?
Thanks in advance
April 8, 2016 at 4:06 am #872536
Paul RModeratorHi,
You can try this code instead.
add_action('x_before_the_content_end', function() { 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"]'); } });Hope that helps.
April 8, 2016 at 8:55 am #872850
ProductionMD1986ParticipantI worked perfectly well!
Thanks a lot!
April 8, 2016 at 9:47 pm #873625
Rue NelModeratorYou’re welcome!
Thanks for letting us know that it has worked for you. -
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-871859 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
