570
文章
·
29023
阅读
570
文章
·
29023
阅读

有32人阅读过 解决安装WordPress错误,以及使用问题
发布于2022/10/26 更新于2022/11/29
[ 教程仅保证更新时有效,请自行测试。]

安装前准备:

wordpress的根目录需要给http用户 读/写 权限,web station 配置时候会提示给权限,但可能给的只有读的权限,需要手动去file station 里修改一下权限。【属性-权限-http-读取+写入】

php需要支持zip扩展名,建议php里勾选所有类扩展名。

image.png


wordpress安装错误,提示邮件格式不正确,又没有看到输入邮件的位置,把服务器切换成Apache

image.png


安装主题,及更新时候提示登录ftp,但不知道怎么登录,或登录错误,

修改网站根目录下的wp-config.php,在前面或尾端加上以下三行,刷新主页即可免登录ftp

define("FS_METHOD", "direct");

define("FS_CHMOD_DIR", 0777);

define("FS_CHMOD_FILE", 0777);


image.png


安装后设置外网访问:

设置-常规,设置后路由做好端口映射。

image.png


设置用户默认头像:

设置-讨论-默认头像

image.png

头像显示缓慢或显示不正常,不显示:

安装插件WPJAM BASIC,尝试更换其他Gravatar加速服务器。

image.png

上传文件时,不允许上传rar等格式文件:

方法1:在根目录wp-config.php文件种添加下面这行,此办法是禁止过滤文件类型,也就是所有格式都可以上传,有一定的隐患。

define('ALLOW_UNFILTERED_UPLOADS', true);

方法2:后台-外观-主题编辑器,选择function.php, 底部增加以下代码:

// 自定义附件类型
function custom_upload_mimes($existing_mimes = array()) {
    // 添加支持上传的文件类型
    $existing_mimes['zip'] = 'application/zip';
    $existing_mimes['rar'] = 'application/x-rar';
    $existing_mimes['exe'] = 'application/octet-stream';
    return $existing_mimes; 
}
add_filter('upload_mimes', 'custom_upload_mimes');

此办法可以实现上传rar,但是实测在wp6.0.3上上传zip依然不行。


EMOJI表情图片显示不了导致页面加载缓慢

在主题目录下,修改function.php文件,加上

remove_action('admin_print_scripts',	'print_emoji_detection_script');
remove_action('admin_print_styles',	'print_emoji_styles');

remove_action('wp_head',		'print_emoji_detection_script',	7);
remove_action('wp_print_styles',	'print_emoji_styles');

remove_action('embed_head',		'print_emoji_detection_script');

remove_filter('the_content_feed',	'wp_staticize_emoji');
remove_filter('comment_text_rss',	'wp_staticize_emoji');
remove_filter('wp_mail',		'wp_staticize_emoji_for_email');

add_filter( 'emoji_svg_url',		'__return_false' );

或者使用插件 WPJAM Basic,禁止emoji转换功能

image.png

文章对你有帮助吗?
  • 一般[0]
  • 很赞[0]
  • 没用[0]
  • 垃圾[0]
  • 无语[0]
扫一扫,手机浏览手机访问本站