上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 34 下一页
摘要: 网站开发时经常遇到需要追踪链接跳转是否正确的需求, 例如在浏览器输入一个链接 https://www.ryanzoe.top/git/how-to-revert-git 由于链接输入不完整,但是我有配置 301 跳转到完整的文章链接,所以最终地址栏显示的链接为 https://www.ryanzoe 阅读全文
posted @ 2020-01-20 12:21 Ryan_zheng 阅读(5863) 评论(0) 推荐(1) 编辑
摘要: 安装扩展 phpformatter 安装完成后,将文档进行格式化后,就会变成如下的代码格式 安装插件后,也可以对格式化进行配置 //打印日志信息,用于调试 "phpformatter.logging": true, //不使用composer方式 "phpformatter.composer": f 阅读全文
posted @ 2020-01-14 08:48 Ryan_zheng 阅读(9167) 评论(0) 推荐(1) 编辑
摘要: Wordpress 插件 Yoast SEO 会默认添加上结构化数据 但是这种结构化数据内容有限,如果需要添加自定义的结构化数据,就需要安装一些专门做结构化数据优化的插件,所以这些结构化插件都会有一个选项,就是不加载 SEO 默认的结构话数据,我们也可以将以下代码移除 SEO data struct 阅读全文
posted @ 2020-01-06 11:34 Ryan_zheng 阅读(275) 评论(0) 推荐(0) 编辑
摘要: ls -l 之后会得到下面的内容 drwx 4 jinwang users 4096 2012-02-09 15:00 .xchat2 -rw-r--r-- 1 jinwang users 1690399 2012-06-04 12:16 45s.txt 文件是以 "-"开头 , 文件夹是 d, 所 阅读全文
posted @ 2020-01-03 12:04 Ryan_zheng 阅读(12146) 评论(0) 推荐(0) 编辑
摘要: WordPress 提供了一个,timer_stop()函数, 官方给出的介绍为:检索或显示从页面开始到调用函数的时间。 简单的说就是我们访问一个 WordPress 链接,服务器生成处理这个页面所需要的时间,当然这并不是指我们打开或者加载这个页面的时间。更多的是服务器端的处理速度和 WordPre 阅读全文
posted @ 2019-12-31 12:04 Ryan_zheng 阅读(954) 评论(0) 推荐(0) 编辑
摘要: $args = array( 'post_type' => array( 'post','knowledgebase'), 'post_status' => 'publish', 'author' => $author_id, 'numberposts'=> $author_all_posts ); 阅读全文
posted @ 2019-12-04 11:55 Ryan_zheng 阅读(554) 评论(0) 推荐(0) 编辑
摘要: 使用 setcookie 函数设置 cookie 报错,报错信息为: setcookie() expects parameter 3 to be integer, float given in... 错误代码 setcookie("user_name", $username, time()+3153 阅读全文
posted @ 2019-12-03 23:03 Ryan_zheng 阅读(974) 评论(0) 推荐(0) 编辑
摘要: wordpress 获取指定作者或者文章的所有评论数量 <?php $args = array( 'post_author' => '' // fill in post author ID ); $author_comments = get_comments($args); echo count($ 阅读全文
posted @ 2019-12-03 17:30 Ryan_zheng 阅读(818) 评论(0) 推荐(0) 编辑
摘要: 通常情况下,为文件添加链接后,用户可以通过点击链接,直接将文件下载到本地,如下载 excel 表格等 <a href="/user/test/xxxx.excel">点击下载</a> 但是有个情况,比如 txt, png, jpg等这些浏览器支持直接打开的文件是不会执行下载任务的,而是会直接打开文件 阅读全文
posted @ 2019-11-30 11:23 Ryan_zheng 阅读(30830) 评论(0) 推荐(1) 编辑
摘要: 一、官网下载对应 PHP 版本的代码库 https://phpunit.de/getting-started-with-phpunit.html 二、安装 PHPUnit 官网提供了两种方法安装 1. PHP Archive (PHAR) ➜ wget -O phpunit https://phar 阅读全文
posted @ 2019-11-28 17:10 Ryan_zheng 阅读(2549) 评论(0) 推荐(0) 编辑
摘要: 首次安装完成 phpstudy 后,默认的 my.ini 配置只有数据库文件位置,其他的都没有设置,这时如果想要输出数据库中的中文后,显示到页面上就会变成中文乱码 解决方法: 打开 phpstudy 配置中的 my.ini,在最后添加下面的配置,然后重启 mysql 即可 [client] defa 阅读全文
posted @ 2019-11-25 14:05 Ryan_zheng 阅读(1733) 评论(0) 推荐(0) 编辑
摘要: 网站开发中,我们经常需要使用链接跳转,比如登录成功后,自动跳转到首页等等,下面方面介绍 PHP & JS 的几种链接跳转方式 PHP <?php header("Location: https://www.ryanzoe.top/"); JS <script> window.location = ' 阅读全文
posted @ 2019-11-24 11:33 Ryan_zheng 阅读(1659) 评论(0) 推荐(0) 编辑
摘要: WordPress 使用的 jQuery 版本由于需要考虑到很多安全稳定的因素,所以一般不会使用最新版本的 jQuery, 可以通过以下方式移除 WordPress 自定加载的 jQuery,并加载自定义的 jQuery // Remove default jquery function custo 阅读全文
posted @ 2019-11-19 11:26 Ryan_zheng 阅读(809) 评论(0) 推荐(0) 编辑
摘要: 如果升级到最新版本的 Wordpress 后,发现有 bug,需要回滚回上一个相对稳定的版本,可以按照如下步骤: 一、到官网下载压缩包 https://wordpress.org/download/releases/ 二、将压缩文件包解压后,修改对应的配置信息,如 wp-config.php 等 阅读全文
posted @ 2019-11-18 11:49 Ryan_zheng 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 使用jquery ajax异步提交的时候报Uncaught TypeError :Illegal invocation错误,报错如图: 基本上,导致这个错误的原因一般有以下两点: 1.请求类型有误,如,post请求,但在后台设置的是get请求 2.参数有误。 如,没有传参,或是参数对应不上去 经过排 阅读全文
posted @ 2019-11-12 09:39 Ryan_zheng 阅读(1240) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 34 下一页