🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
### 安装WP必备知识 ### 安装 wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.zip 请下载最新的版本哦。官网: https://cn.wordpress.org/txt-download/ 准备解压 yum install zip unzip unzip w 然后tab键 配置apache <VirtualHost *:80> DocumentRoot /web/wordpress ServerName m.wstaichi.com </VirtualHost> 重启服务 service httpd reload 不用配置FTP,在线可安装插件、主题的解决方法 在 ` vim wp-config.php` 找到 if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); 之后添加以下代码 define('WP_TEMP_DIR', ABSPATH.'wp-content/tmp'); define("FS_METHOD", "direct"); define("FS_CHMOD_DIR", 0777); define("FS_CHMOD_FILE", 0777); 设置权限 mkdir wp-content/tmp chmod -R 777 wp-content/ 禁用google css链接,插件搜索。国内访问google的css js大部分不能访问。 Disable Google Fonts Ps Display Upload_path ##修改默认上传图片的URL 支持SSL,在主题functions.php里添加以下代码 add_filter('script_loader_src', 'agnostic_script_loader_src', 20,2); function agnostic_script_loader_src($src, $handle) { return preg_replace('/^(http|https):/', '', $src); } add_filter('style_loader_src', 'agnostic_style_loader_src', 20,2); function agnostic_style_loader_src($src, $handle) { return preg_replace('/^(http|https):/', '', $src); } /* 替换图片链接为 https */ function my_content($content){ if( is_ssl() ){ $content = str_replace('//', 'https://', $content); } return $content; } add_filter('the_content', 'my_content'); 后台支持https `vim wp-config.php ` /* 强制后台和登录使用 SSL */ $_SERVER['HTTPS'] = 'on'; define('FORCE_SSL_LOGIN', true); define('FORCE_SSL_ADMIN', true); 一定要在 `require_once(ABSPATH . 'wp-settings.php');` 上面加入以上代码