然后通过Js来实现点击按钮的时候切换class样式即可: 具体样式可根据自己的需求调整。
Read More »Recent Posts
WordPress文章如何添加浏览次数
在主题文件夹下面的inc文件夹(如果没有就新建一个),新建一个postviews.php文件,然后在functions.php里面引入: require get_template_directory() . '/inc/postviews.php' 然后在文件里粘贴: <?php // function to display number of posts. // 可以在后台设置一个option来决定是否开启浏览次数 func...
Read More »jQuery的success\error和done\fail
在jQuery里面,success和error和done,fail函数做的事情都是一样的。 success参数特定回调函数当请求顺利完成时,然后从后端获取到data作为自己传递的参数。 $.ajax({ url: "some.php", type: "POST", data: { name: "John", location: "Boston" }, success: function(data) { console.log("Success:...
Read More »