Certainly! Git is a powerful version control system that allows developers to track changes to their code, collaborate with others, and manage software development projects efficiently. Here's a comprehensive tutorial to get you started with Git: Table of Contents: Introduction to Git ...
阅读更多 »Masonry Layout
关于query_vars的一些解释
query_vars就是查询时候的一些参数,比方说你提交wp_query自定义查询的时候要设置cat名字 , 文章类型, tag名字等, 这些就是你发送wp_query请求时候附带的query vars, 这个query 查询所有满足变量条件的查询。 其他查询也是一样,打印出来的结果就是结果,而你代码上则是原因。 get_query_var 则是获取到query_v...
阅读更多 »wp置顶文章只在第一页第二页还输出置顶文章的解决方案
wp默认的置顶文章只在第一页置顶,超过第一页的话置顶文章依然还会存在他原来的位置上,要解决这种方法,让置顶文章一直都消失在第一页置顶的话,参考下面的代码进行输出: 或者直接用两个wp query分别输出 $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; // Fetch sticky posts separately $st...
阅读更多 »WP rest api 文字教程
概述 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()方法不包括文件输入,因为出于安全和技术考虑,文件上传需要特殊处理。文件输入包含二进制数据(文件本身),这些数据不能以与文本字段或其他表单元素相同的...
阅读更多 »
WP开发教程 WordPress导师在线教程