概述 REST API 为我们提供了一种将 URI 与 WordPress 安装中的各种资源相匹配的方法。默认情况下,如果您启用了漂亮的永久链接,则 WordPress REST API “存在”于 /wp-json/。在我们的 WordPress 网站https://ourawesomesite.com`, we can access the REST API's index by making aGETrequest tohttps://ourawesomesi...
阅读更多 »不用插件给WP图库画廊添加lightbox效果
<?php /* * */ add_action( 'wp_footer', function(){ if(!is_admin()) { ?> <style> img { display: block; max-width: 100%; } .lightbox { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 999999; background-color: rgba(0, 0, 0, 0.75); display: flex; justify-...
阅读更多 »测试文章类型
I'm baby marxism bodega boys mlkshk 3 wolf moon food truck. Cred sriracha stumptown readymade put a bird on it, leggings umami pinterest thundercats Brooklyn vexillologist microdosing selvage meh. Neutral milk hotel edison bulb etsy hell of flexitarian stumptown paleo. Bodega boys gastropub lomo...
阅读更多 »超级链接形式
https://world.siteground.com/wordpress-hosting.htm?index_hero_button#view
阅读更多 »获取input的keyup或者input状态只获取一次值避免无限重复值
$(document).ready(function () { // Select the text input field var textInput = $("#textInput"); var delayTimer; // Attach an event handler to the input field for the "input" event textInput.on("input", function () { clearTimeout(delayTimer); delayTimer...
阅读更多 »input file字段选择图片之后怎么实现预览(还未上传到服务器的情况下)
$("#txt_image").on('change',function(){ console.log('on change'); if (this.files && this.files[0] ) { const reader = new FileReader(); reader.onload = function(e){ $("#book-image-preview").attr('src',e.target.result); } reader.r...
阅读更多 »js提交form数据的时候如果要包含file数据要用到FormData对象
通过创建一个FormData对象并将表单元素(包括文件输入)附加到该对象,您应该能够成功地将文件作为$_FILES数组的一部分发送到后端。 jQuery中的serialize()方法不包括文件输入,因为出于安全和技术考虑,文件上传需要特殊处理。文件输入包含二进制数据(文件本身),这些数据不能以与文本字段或其他表单元素相同的...
阅读更多 »JS系统教程四-operator
算法操作符
阅读更多 »JS系统教程三-type conversion
如何将数据转换成不同类型 const name = 'Jony'; const age = 30; const person = { name:'brad', age:55 } let amount = 100; // change string to number ////////////////////////////// // amount = parseInt(amount); // // const num = 99.5; // amount = parseFloat(num); 会显示小数 ...
阅读更多 »JS系统教程二-数据种类
了解内存里面的stack和heap , 数据形式村在stack的是是原始数据,存在数组,对象和函数里的,是参考数据。 stack和heap的概念 heap是stack的子层
阅读更多 »
WP开发教程 WordPress导师在线教程