wordpress线上部署&更新主题

新增主题

  1. 随便复制一个主题到test文件夹
  2. test主题文件cnpm I
    npm i 失败的可以使用淘宝镜像 cpm i
  3. 热更新

主题介绍

test目录下的style.css

/*
Theme Name: 主题名
Text Domain: 由来(哪个团队)
Version: 1.0
Requires at least: 4.7
Requires PHP: 5.2.4
Description: 简介
Author: 作者
Author URI: https://wordpress.org/
Theme URI: https://wordpress.org/themes/twentytwenty/
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

All files, unless otherwise stated, are released under the GNU General Public
License version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html)

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned
with others.
*/

替换主题封面
主题封面是红色框内的图片,只要替换主题目录下的图片screenshot.png(1200*900)
在这里插入图片描述

部署到线上

WordPress站需要转https,各种配置都配了,前台、登录页也显示正常,但就是登录不了后台页面!!

问题1: “抱歉,您不能访问此页面”

  1. 在根目录wp-config.php这个文件中,添加代码:
$_SERVER['HTTPS'] = 'on';
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);

注:一定要放在if ( ! defined( ‘ABSPATH’ ) ) 之前
在这里插入图片描述

  1. 数据库修改数据 http 改成 https
    在这里插入图片描述

更新主题

只需要更换该主题文件 wp-content/themes/主题名

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值