代码实现 关闭后台自动更新功能

代码实现 关闭后台自动更新功能 1https://www.91wordpress.com/934.html 1. 关闭后台更新提示 切换到主题目录,打开functions.php文件,加入以下代码: 12cd /home/wwwroot/default/vermaxcn/wp-content/themes/flatsome/ vi functions.php 1234567//移除更新提示 function remove_core_updates(){  global $wp_version;return(object) array(‘last_checked’=> time(),’version_checked’=> $wp_version,); } add_filter(‘pre_site_transient_update_core’,’remove_core_updates’); add_filter(‘pre_site_transient_update_plugins’,’remove_core_updates’); add_filter(‘pre_site_transient_update_themes’,’remove_core_updates’); 2. 关闭自动更新功能切换到网站根目录,打开config.php文件,加入以下代码: 12cd /home/wwwroot/default/vermaxcn vi wp-config.php 1define( ‘AUTOMATIC_UPDATER_DISABLED’, true ); 3. 重启 nginx 1systemctl restart nginx.service 4. 已成功,后台 修改前后对比

WP-Rocket 缓存神器

WP-Rocket 缓存神器 1234https://www.xgboke.com/719.html https://www.qcwlseo.com/wp-rocket.html https://www.imhunk.com/wp-rocket-configuration/ https://www.kejianet.cn/wp-rocket/ 别的都运行很好,但到第13步时,老出现错误”[emerg] “set” directive is not allowed here in /usr/local/nginx/conf/vhost/rocket.conf:17″ WP-Rocket 是明月一直很推崇的 WordPress 下本地缓存插件,可以说相对于 WP Super Cache 和 W3 Total Cache 短小精悍了很多, 设置也没有那么复杂,兼容性很完美,特别是缓存效果几乎就是“立竿见影”,草根博客站长们优化 WordPress 的必备神器。 1. 下载及购买地址 下载地址: https://webcode.versca.cn/wordpress/plugin/wp-rocket-v3.3.zip 购买地址: https://wp-rocket.me/ [$47 /年] 2. WP rocket 的Dashboard菜单的设置 安装并激活wp rocket之后,进入插件列表,点击wp rocket插件那里的settings,就直接进入设置页面的Dashboard菜单 这里面有几个菜单 My account 这里是查看你的账号及过期日期 My status 这里有两个参与wp rocket插件的测试的菜单,一般不用开启 Quick actions […]

CentOS7.4安装部署KVM虚拟机

CentOS7.4安装部署KVM虚拟机 1https://blog.csdn.net/qq_39452428/article/details/80781403 0. 安装带有KVM虚拟机的CentOS 7.4 1. 查看系统版本 1cat /etc/centos-release 2. 首先验证CPU是否支持虚拟化,输入有vmx或svm就支持,支持虚拟化则就支持KVM 1cat /proc/cpuinfo | egrep ‘vmx|svm’ 3. 查看是否加载KVM 1lsmod | grep kvm 这表明已经加载,如果没有加载则执行以下命令加载KVM 1modprobe kvm 4. 关闭selinux 12setenforce 0 vi /etc/sysconfig/selinux 1SELINUX=disabled      //原本enforcing 5. 安装KVM相关软件包 123yum install qemu-kvm qemu-img \ virt-manager libvirt libvirt-python virt-manager \ libvirt-client virt-install virt-viewer -y qemu-kvm: KVM模块 libvirt: 虚拟管理模块 […]

定期导出数据库,按导出时间保存

定期导出数据库,按导出时间保存 12https://blog.csdn.net/qq_33355821/article/details/102393007 https://blog.csdn.net/weixin_39772795/article/details/81276785 1. 导出所有数据库 12语法: mysqldump -u用户名 -p密码 –all-databases >导出路径 举例: mysqldump -uver****** -pAnc********** –all-databases >/home/wwwroot/default/mysql/all.sql 2. 导出所有数据库,按导出时间保存 1举例: mysqldump -uver****** -pAnc********** –all-databases >/home/wwwroot/default/mysql/all-`date "+%Y-%m-%d-%H-%M-%S"`.sql 3. 通过 sql 文件导入数据库 12语法: mysql -u用户名 -p密码 < 导入路径 举例: mysql -uver****** -pAnc********** < /home/wwwroot/default/webdata/mysql/all.sql 4. 导出单个数据库.[这样更方便] 12mysqldump -uver****** -pAnc********** –databases vermaxcn > /home/wwwroot/vermaxcn.sql mysqldump -uver****** -pAnc********** –databases […]

functions.php 中添加如下代码可以实现版本号的隐藏

functions.php 中添加如下代码可以实现版本号的隐藏 1https://blog.csdn.net/weixin_34259159/article/details/94605039 12cd /home/wwwroot/default/vermaxcn/wp-content/themes/flatsome/ vi functions.php 1234567891011121314function ludou_remove_wp_version() {   return ”; } add_filter(‘the_generator’, ‘ludou_remove_wp_version’); function ludou_remove_wp_version_strings( $src ) {   global $wp_version;   parse_str(parse_url($src, PHP_URL_QUERY), $query);   if ( !empty($query[‘ver’]) && $query[‘ver’] === $wp_version ) {     $src = str_replace($wp_version, $wp_version + 82.01, $src);   }   return $src; } add_filter( ‘script_loader_src’, […]

WordPress优化技巧:删除CSS和JS文件后面的版本号

WordPress优化技巧:删除CSS和JS文件后面的版本号 1https://www.91wordpress.com/862.html 使用WordPress做完网站以后,当我们查看网站源代码的时候,发现WordPress调用自身或插件的CSS文件和JS文件的后方都带着版本号,如下图: 这样看起来既不美观,又暴漏了我们使用的WordPress的信息,更重要的是,你修改css里面代码时不起做用.所以要去掉。 方法: 12cd /home/wwwroot/default/vermaxcn/wp-content/themes/flatsome/ vi functions.php 增加以下代码: 1234567function sb_remove_script_version( $src ){ $parts = explode( ‘?’, $src ); return $parts[0]; } add_filter( ‘script_loader_src’, ‘sb_remove_script_version’, 15, 1 ); add_filter( ‘style_loader_src’, ‘sb_remove_script_version’, 15, 1 ); add_action(‘login_enqueue_scripts’,’login_protection’); 1systemctl restart nginx.service      //重启nginx 刷新时发现这次没有版本号了 12cd /home/wwwroot/default/vermaxcn/wp-content/themes/flatsome/assets/css/ vi flatsome.css body{color:#777; 改成 #000777 1systemctl restart nginx.service 这时发现所有字的颜色都变了.

USB2JFFS – 用U盘来挂载jffs

USB2JFFS – 用U盘来挂载jffs 1https://koolshare.cn/thread-178957-1-1.html 1. 查看路由器是否有坏道 1dmesg|grep "bad block" 还好没有坏道 2. 手动实现U盘挂载jffs 要实现U盘挂载jffs本身不难,以RT-AC1900P为例 插上U盘 1df -h           //可以看到我们的U盘挂载到什么路径了 得出结果 123456Filesystem                Size      Used Available Use% Mounted on /dev/root                33.9M     33.9M         […]

U盘格式化为ext4格式

U盘格式化为ext4格式 1https://blog.csdn.net/wqy_zyc/article/details/79537854 具体操作 步骤: 1.下载MiniTool Partition Wizard 软件 下载地址:13225921203@pan.baidu.com/重要文件/winsoft/MiniToolPartitionWizardFree_9.0_XiaZaiBa.zip 2. 安装 以管理员身份运行 3. 安装好后: 没插U盘或读卡器前: 插U盘或读卡器(外接内存)后: 4.删除分区 步骤1: 步骤2: 步骤3: 5.创建分区 步骤1: 步骤2: 以下是我自己创建的分区ext4和Linux swap格式: 6.最后一步点击apply,等待几分钟,完事。 7. 把格式化好的U盘插到路由器上. 路由器后台 – 软件中心 – USB2JFFS 就可以看到数据了

用代码修改Flatsome背景颜色

用代码修改Flatsome背景颜色 例如:bndstone.com 1. chrome或firefox浏览器 打开bndstone.com 2. 空白地方 右键 – 审核元素 [chrome浏览器也叫检查] 3. 可以看到 css位置 https://www.versca.cn/wp-content/themes/flatsome/assets/css/flatsome.css?ver=3.8.4 123456789101112131415161718192021222324252627282930313233343536box-sizing  border-box color  rgb(119,119,119) display  block font-family  lato,sans-serif font-weight  400 line-height  25.6px margin-bottom  0px margin-left  0px margin-right  0px margin-top  0px padding-bottom  30px padding-left  15px padding-right  15px padding-top  0px position  relative text-size-adjust  100% width  709px -webkit-font-smoothing    /* Safari */  antialiased […]

用代码实现 Page页面 及 Product页面 加 “.html”

用代码实现 Page页面 及 Product页面 加 “.html” 12http://zmingcx.com/wordpress-page-link-html-suffix.html http://zmingcx.com/wordpress-page-tags-url-add-html-suffix.html       //加插件的方法 123settings > permalinks > Common Settings > Custom Structure > /%postname%.html settings > permalinks > Product permalinks > Custom base > /product/ save change [PAGE页面加”.html”] 12cd /home/wwwroot/default/huajunstone/wp-content/themes/flatsome/ vi functions.php 1234567add_action(‘init’, ‘html_page_permalink’, -1); function html_page_permalink() {     global $wp_rewrite;     if ( […]