Is there a way how to add social shares button to the bottom of each Page please ?
I have activated it to appear on Posts, but cannot figure out how to add them to Pages.
Thanking you
Hi,
The social sharing you mention is only available for posts
– https://forum.tagdiv.com/sharing/
You can only share posts, not pages. On pages you could use the Social counter element
– https://forum.tagdiv.com/tagdiv-social-counter-tutorial-2/
– https://forum.tagdiv.com/social-counter-styles-on-newspaper/
Thanks
Hi,
The post social sharing will probably not work properly, even if you managed to add them to the page templates. This should not be attempted, the sharing is designed and implemented in the post page.
There are many sharing plugins that you could try if you require additional sharing options. Please search for some plugins for sharing, and try a few of them until you find what is required.
Thanks
Hello
To every one searching for a way to add share buttons on pages here is how i did it with out plugin :
1 go to function.php in your theme root( better use child theme so you dont lose modifications when updating) :
2- add the following code :
/* ----------------------------------------------------------------------------*/
// Share buttons on pages' bottom
// PS: no-follow tag was added to external links
function tagdiv_social_buttons($content) {
global $post;
$permalink = get_permalink($post->ID);
$title = get_the_title();
//don't show buttons on frontpage and other pages id
if( !is_front_page() && !is_page(array( 1, 2,3,4,5,6 )) && $post->post_type=='page' ) {
$content = $content . '<div class="td-post-sharing td-post-sharing-top tagdiv-share">
<a class="td-social-sharing-buttons td-social-facebook" rel="nofollow"
href="https://www.facebook.com/sharer.php?u=' . urlencode( esc_url( get_permalink() ) ) . '"
onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;">
<i class="td-icon-facebook"></i><div class="td-social-but-text">share on facebook</div>
<a class="td-social-sharing-buttons td-social-twitter" rel="nofollow" href="http://twitter.com/share?text='.$title.'&url='.$permalink.'"
onclick="window.open(this.href, \'twitter-share\', \'width=550,height=235\');return false;">
<i class="td-icon-twitter"></i><div class="td-social-but-text">share on twitter</div>
<a class="td-social-sharing-buttons td-social-google tagdiv-google" rel="nofollow" href="https://plus.google.com/share?url=' . esc_url( get_permalink() ) . '"
onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;">
<i class="td-icon-googleplus"></i><div class="td-social-but-text tagdiv-google-border">share on google</div>
</div>';
}
return $content;
}
add_filter('the_content', 'tagdiv_social_buttons');
// use short code [tagdivsocial] to show buttons where ever you need
add_shortcode('tagdivsocial', 'tagdiv_social_buttons');
`
3 then add the following css to theme panel of your style.css file:
<code>
.tagdiv-share {
margin: 21px auto;
text-align: center;
font-family: 'Droid Arabic Kufi', arial, sans-serif !important;
}
.tagdiv-google{
width: 160px !important;
}
.tagdiv-google-border{
border-right: 1px solid rgba(255, 255, 255, 0.2);
}
</code>
and every thing is working fine
hope this help any one looking.
-
This reply was modified 8 years by
biznizat. Reason: FIXING
