WordPress博客添加微信/支付宝打赏功能 – 任意网站通用无插件
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |

蜗牛在网友博客中转悠的时候经常看到内容页面下方有打赏功能,之前一直想加到上面去,但是总觉着如果加上去有点向网友索要点什么似得。前几天,网友在群里讨论这个问题,提到还是有必要加上一个,万一分享的技术、文章、方法可以帮助到网友且有的网友也会通过发个奖赏之类的。
今天工作空闲时间,从WP大学(wpdaxue.com)网站看到认为还不错的效果且没有用到插件,于是整理过来添加到蜗牛部落中,我们现在也可以看到效果感觉还是不错的。可以加上微信、支付宝的收款二维码。
这个打赏功能采用的是无插件,直接CSS实现的,顺带把代码分享出来,如果有用户也有需要用到可以直接使用。这里要申明的是,我也是从WPDAXUE抠出来的,版权归属倡萌同学,仅仅是将好的东西分享给大家提供便捷。我们可以将安装到任何网站中。
第一、CSS部分
.reward{padding:5px 0}.reward .reward-notice{font-size:14px;line-height:14px;margin:15px auto;text-align:center}.reward .reward-button{font-size:28px;line-height:58px;position:relative;display:block;width:60px;height:60px;margin:0 auto;padding:0;-webkit-user-select:none;text-align:center;vertical-align:middle;color:#fff;border:1px solid #f1b60e;border-radius:50%;background:#fccd60;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fccd60),color-stop(100%,#fbae12),color-stop(100%,#2989d8),color-stop(100%,#207cca));background:-webkit-linear-gradient(top,#fccd60 0,#fbae12 100%,#2989d8 100%,#207cca 100%);background:linear-gradient(to bottom,#fccd60 0,#fbae12 100%,#2989d8 100%,#207cca 100%)}.reward .reward-code{position:absolute;top:-220px;left:50%;display:none;width:350px;height:200px;margin-left:-175px;padding:15px;border:1px solid #e6e6e6;background:#fff;box-shadow:0 1px 1px 1px #efefef}.reward .reward-button:hover .reward-code{display:block}.reward .reward-code span{display:inline-block;width:150px;height:150px}.reward .reward-code span.alipay-code{float:left}.reward .reward-code span.alipay-code a{padding:0}.reward .reward-code span.wechat-code{float:right}.reward .reward-code img{display:inline-block;float:left;width:150px;height:150px;margin:0 auto;border:0}.reward .reward-code b{font-size:14px;line-height:26px;display:block;margin:0;text-align:center;color:#666}.reward .reward-code b.notice{line-height:2rem;margin-top:-1rem;color:#999}.reward .reward-code:after,.reward .reward-code:before{position:absolute;content:\’\’;border:10px solid transparent}.reward .reward-code:after{bottom:-19px;left:50%;margin-left:-10px;border-top-color:#fff}.reward .reward-code:before{bottom:-20px;left:50%;margin-left:-10px;border-top-color:#e6e6e6}
将CSS放到我们的CSS文件中,注意是否与我们已有的CSS命令有冲突,如果有则需要修改。
2、调用部分
<div class=\”reward\”><div class=\”reward-button\”>赏 <span class=\”reward-code\”> <span class=\”alipay-code\”> <img class=\”alipay-img\” src=\”支付宝收款二维码地址200*200PX\”><b>支付宝扫码打赏</b> </span> <span class=\”wechat-code\”> <img class=\”wechat-img\” src=\”微信收款二维码地址200*200PX\”><b>微信打赏</b> </span> </span></div><p class=\”reward-notice\”>如果文章对您有帮助,欢迎移至上方按钮打赏蜗牛</p></div>
根据我们的需要,将需要调用打赏功能的页面、模板添加上面调用代码。
PS:需要提到的是,我们预先要做2个图片,从支付宝、微信中先下载到收款的二维码,然后替换成自己的图片,千万别放我的。
猜你可能想看的VPS
- DogYun 德国(CN2) 香港(CMI)上线 支持小时计费 自助换 香港VPS[主机]
- WordPress 后台更新升级出现"您确定要这样做?"的解决办法全球[VPS测评]
- tp5 模板中使用自定义函数的方法全球[VPS测评]
- 阿里国际→香港虚拟主机 5GB 空间 512MB 内存 50GB 月流量虚拟空间(主机)
- 补货通知 搬瓦工→CN2 GIA 线路$46.87 年机器补货了 速度上全球[VPS测评]
- CoalCloud→368 元 年 384MB 内存 8GB SSD 空虚拟空间(主机)
- 香港直连 ¥432 年 2 内存 30G 硬盘 300G 流量 30Mb香港VPS[主机]
- vultr 韩国 vps 云服务器上线,三网直连,按小时计费,1 核 1韩国VPS[主机]
- iWFHosting→KVM2G 每月 8.99 美元起 洛杉矶可选 1全球[VPS测评]
- ByteDynasty→26.25 元 月 768MB 内存 8GB S虚拟空间(主机)
- SpartanHost→西雅图高防 KVM 月付 2 美元起 支持支付宝全球[VPS测评]
- 如何不需要使用插件就可以实现WordPress代码高亮功能全球[VPS测评]
- RackNerd圣诞节1.5g内存20g硬盘2.5T大流量年付仅16.8全球[VPS测评]
- 搬瓦工年付19.99刀10G KVM CN2传家宝全球[VPS测评]
- 如何注册解析.tk,.ml,.ga,.cf,.gq等免费域名全球[VPS测评]
- Linode正式更换至新的云管理面板全球[VPS测评]
- hostetski-俄罗斯圣彼得堡49卢布 月1Gbps NAT VPS全球[VPS测评]
- 什么是VPS?国内VPS有哪些?全球[VPS测评]
- 跨境电商平台首选香港服务器香港VPS[主机]
- 买了一台云服务器到底能干什么?全球[VPS测评]
- 谷歌浏览器网址如何显示http,www,Chrome谷歌浏览器恢复地址栏全球[VPS测评]
- 买了一台云服务器到底能干什么?全球[VPS测评]
- 企鹅小屋:香港VPS限时3折优惠,香港沙田CN2,原生IP,年付486.香港VPS[主机]
- 快速云:怎么连接vps?VPS的用途有哪些?全球[VPS测评]
- wordpress 上传附件报错 “抱歉,出于安全的考虑,不支持此文件类全球[VPS测评]
- 瓜云互联怎么样?香港/美国洛杉矶CN2高防vps 50G月付34元美国VPS[主机]
- 三优云uuuvps:春节促销,香港cn2 vps低至168元/年,多款配香港VPS[主机]
- 亿恩科技香港云服务器 2核2G服务器特价700元/年香港VPS[主机]
- 一篇漫画,看懂云计算全球[VPS测评]
- 文物、沉船、村落!干旱导致大量遗迹重见天日 2022年干旱还要持续多久?全球[VPS测评]
转载请注明原文地址:http://140.238.13.167:12355/read-39929.html











