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
- ThinkPHP5 动态创建数据表方法全球[VPS测评]
- 疯狂猜成语 图猜成语一个锤子在打铁还有火苗是什么成语?全球[VPS测评]
- CloudCone→$2 月 KVM-512MB 15GB 3TB 洛杉全球[VPS测评]
- 优惠 趣味云→首月 6 折 香港 CN2 线路 1G 内存套餐首月仅需 香港VPS[主机]
- Oracle Cloud - 甲骨文云主机各机房测试 IP全球[VPS测评]
- Laravel→SQLSTATE[42000]: Syntax erro全球[VPS测评]
- layer .tips 没有回调函数怎么办?全球[VPS测评]
- CentOS7 创建并启用 RAMDISK(内存盘)全球[VPS测评]
- 299 元 年 1G 内存 15G SSD 2Mbps 不限量 XEN 香港VPS[主机]
- BGPTO→637 元 月 E3-1230v3 8GB 2TB 5IP 全球[VPS测评]
- CentOS 下 iptables 防火墙基本操作教程全球[VPS测评]
- 便宜 VPS $10.5 首年 512M 内存 10G SSD 500G全球[VPS测评]
- Uovz→3500 元 年 L5630*2 8GB 内存 146GB S全球[VPS测评]
- 搬瓦工→新增 10Gbps 带宽的 cn2 gia 线路 VPS 移动+全球[VPS测评]
- 新博客如何快速通过 Google AdSense 账号申请全球[VPS测评]
- YYYHost洛杉矶高防CN2GIA1G内存8m带宽外加100g防御 月全球[VPS测评]
- Dchost-月付$2.6 土耳其 7折 1核2G内存40G硬盘 1Gb全球[VPS测评]
- 8K超高清记录中国空间站凌月:天和核心舱与问天实验舱组成“土”字结构虚拟空间(主机)
- CIO和其他IT领导者充分利用边缘计算增强业务的4个关键全球[VPS测评]
- 亿恩科技香港云服务器 2核2G服务器特价700元/年香港VPS[主机]
- 长三角地区的算力需求规模到底有多大?全球[VPS测评]
- 曾经最大跨境电商平台团队收缩,只剩20人丨GoingGlobal周报全球[VPS测评]
- 老六云怎么样?香港cn2vps月付23元香港NTT月付9.9元香港VPS[主机]
- 缓解云计算人才焦渴,苏州工业园区用三年引得源头活水来全球[VPS测评]
- ERP库存管理系统HTML5模板 - DreamsPOS全球[VPS测评]
- Vultr新用户100美金 最新活动来啦!新用户充值活动来了,充100美全球[VPS测评]
- 2022年亚马逊Prime会员日将于7月12日和13日举行,覆盖24个站全球[VPS测评]
- 者也IO,香港日本美国云服务器促销,2核2G1000元/2年,7折+内存日本VPS[主机]
- MineServer:香港cn2/日本cn2云服务器,2核/2G/35G虚拟空间(主机)
- 老六云怎么样?香港cn2vps月付23元香港NTT月付9.9元香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-142930.html











