WPML
状态
已解决
报告针对
WPML Multilingual CMS 3.5.3.1
解决于
WPML Multilingual CMS 3.6.0

问题概述

如果您有一个在设置 -> 阅读 页面上设置的静态主页,您可能会注意到它使用了错误的模板。

当主页以其他(非默认)语言更新时,就会发生这种情况。

导致该问题的原因是某些元字段未被正确读取,并且其值被设置为空。

临时解决方法

此问题将在下一个版本中修复。在此之前,您可以使用以下临时解决方法。

前往 wp-content/plugins/sitepress-multiligual-cms/inc/post-translation 文件夹并编辑 wpml-post-synchronization.class.php 文件。

找到以下代码行:

$page_template = $this->sync_page_template && get_post_type( $post_id ) === 'page' ? get_page_template_slug( $post_id ) : null;

将上述(现有)代码替换为以下代码:

$page_template = $this->sync_page_template && get_post_type( $post_id ) === 'page' ? get_post_meta( $post_id, '_wp_page_template', true ) : null;

所有已知问题 →