简体   繁体   English

如何为php网站中的每个帖子添加社交共享按钮?

[英]How to add social sharing buttons for each Post in php website?

I am going to build a wallpapers website in php. 我将用php建立一个墙纸网站。 I want to add social share button for each Post. 我想为每个帖子添加社交分享按钮。

Here is a Code Snippet. 这是一个代码片段。 Trythis 尝试这个

<div id="share-buttons">

<!-- Buffer -->
<a href="https://bufferapp.com/add?url=https://simplesharebuttons.com&amp;text=Simple Share Buttons" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/buffer.png" alt="Buffer" />
</a>

<!-- Digg -->
<a href="https://www.digg./submit?url=https://simplesharebuttons.com" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/diggit.png" alt="Digg" />
</a>

<!-- Email -->
<a href="mailto:?Subject=Simple Share Buttons&amp;Body=I%20saw%20this%20and%20thought%20of%20you!%20 https://simplesharebuttons.com">
    <img src="https://simplesharebuttons.com/images/somacro/email.png" alt="Email" />
</a>

<!-- Facebook -->
<a href="http://www.facebook.com/sharer.php?u=https://simplesharebuttons.com" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/facebook.png" alt="Facebook" />
</a>

<!-- Google+ -->
<a href="https://plus.google.com/share?url=https://simplesharebuttons.com" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/google.png" alt="Google" />
</a>

<!-- LinkedIn -->
<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=https://simplesharebuttons.com" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/linkedin.png" alt="LinkedIn" />
</a>

<!-- Pinterest -->
<a href="javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());">
    <img src="https://simplesharebuttons.com/images/somacro/pinterest.png" alt="Pinterest" />
</a>

<!-- Print -->
<a href="javascript:;" onclick="window.print()">
    <img src="https://simplesharebuttons.com/images/somacro/print.png" alt="Print" />
</a>

<!-- Reddit -->
<a href="http://reddit.com/submit?url=https://simplesharebuttons.com&amp;title=Simple Share Buttons" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/reddit.png" alt="Reddit" />
</a>

<!-- StumbleUpon-->
<a href="http://www.stumbleupon.com/submit?url=https://simplesharebuttons.com&amp;title=Simple Share Buttons" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/stumbleupon.png" alt="StumbleUpon" />
</a>

<!-- Tumblr-->
<a href="http://www.tumblr.com/share/link?url=https://simplesharebuttons.com&amp;title=Simple Share Buttons" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/tumblr.png" alt="Tumblr" />
</a>

<!-- Twitter -->
<a href="https://twitter.com/share?url=https://simplesharebuttons.com&amp;text=Simple%20Share%20Buttons&amp;hashtags=simplesharebuttons" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/twitter.png" alt="Twitter" />
</a>

<!-- VK -->
<a href="http://vkontakte.ru/share.php?url=https://simplesharebuttons.com" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/vk.png" alt="VK" />
</a>

<!-- Yummly -->
<a href="http://www.yummly.com/urb/verify?url=https://simplesharebuttons.com&amp;title=Simple Share Buttons" target="_blank">
    <img src="https://simplesharebuttons.com/images/somacro/yummly.png" alt="Yummly" />
</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM