0

我在尝试进入我的 WordPress 的某些页面时收到了这条奇怪的消息。

警告:require_once(/home3/alexismoyano/calendario/calendario/wp-content/themes/twentynineteen/includes/bootstrap.php):无法打开流:/home3/alexismoyano/calendario/calendario/wp-中没有这样的文件或目录第 51 行的 content/themes/Avada/functions.php

致命错误:require_once():打开失败需要'/home3/alexismoyano/calendario/calendario/wp-content/themes/twentynineteen/includes/bootstrap.php' (include_path='.:/opt/php70/lib/php')在第 51 行的 /home3/alexismoyano/calendario/calendario/wp-content/themes/Avada/functions.php

我不明白它可能是什么,它似乎与主题“Twentnineteen”有关,尽管我什至没有使用它。

这是第 51 行的内容:

This is what it says on line 51:

第 51 行:“require_once get_template_directory().'/includes/bootstrap.php';”

/**
 * Check that the site meets the minimum requirements for the theme before proceeding.
 * @since 6.0
 */
if ( version_compare( $GLOBALS['wp_version'], AVADA_MIN_WP_VER_REQUIRED, '<' ) || version_compare( PHP_VERSION, AVADA_MIN_PHP_VER_REQUIRED, '<' ) ) {
    require_once get_template_directory() . '/includes/bootstrap-compat.php';
    return;
}

/**
 * Bootstrap the theme.
 *
 * @since 6.0
 */
require_once get_template_directory() . '/includes/bootstrap.php';

有人知道我该如何解决吗?

4

1 回答 1

0

根据您的评论,主题似乎twentynineteen设置为模板主题,而 Avada 设置为子主题。

除了它首先查看模板/父主题而不是当前(子)主题之外,该功能get_template_directory()相同。get_stylesheet_directory()

查看Child Themes的文档。您会注意到文件顶部有一个注释块,style.css用于确定父/模板主题,例如:

/*
 Theme Name:   Some Child Theme
 Author:       John Doe
 Author URI:   http://example.com
 Template:     twentynineteen
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
*/

您在那里看到 in line Template: twentynineteen,这告诉您的活动主题将其用作父主题。

现在,我不熟悉 Avada,但它应该是 Twentynineteen 的儿童主题吗?我不相信,但如果,请尝试重新安装二十九主题。如果它不应该是,那么确保你的文件Template: twentynineteen中没有一行style.css

如果这些都不起作用,您也可以尝试用get_template_{…}()函数替换get_stylesheet_{…}()函数,但是如果/当您更新主题时,这些函数会被还原。

于 2020-02-05T18:20:11.400 回答