0
votes

I'm getting this weird message while trying to enter some of the pages of my WordPress.

Warning: require_once(/home3/alexismoyano/calendario/calendario/wp-content/themes/twentynineteen/includes/bootstrap.php): failed to open stream: No such file or directory in /home3/alexismoyano/calendario/calendario/wp-content/themes/Avada/functions.php on line 51

Fatal error: require_once(): Failed opening required '/home3/alexismoyano/calendario/calendario/wp-content/themes/twentynineteen/includes/bootstrap.php' (include_path='.:/opt/php70/lib/php') in /home3/alexismoyano/calendario/calendario/wp-content/themes/Avada/functions.php on line 51

I don't understand what could it be, it seems to be related to the theme "Twentnineteen" despite I'm not even using it.

This is what it's on LINE 51:

This is what it says on line 51:

LINE 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';

Does someone know how can I solve it?

1
The issue is on your /themes/Avada/functions.php on line 51. A function that's there is referencing the file in the twentyninteen theme on that line. You'll need to post the code around there to see what's going on - Xhynk
This is what it says on line 51: LINE 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'; - AleMoyano
I edited the original question so that it's more readable. - AleMoyano

1 Answers

0
votes

Based on your comments, it looks like the twentynineteen theme is set as a template theme, and Avada is set as a child theme.

The function get_template_directory() is identical to get_stylesheet_directory() except for the fact it looks at the Template/Parent theme first instead of the current (child) theme.

Take a look at the documentation for Child Themes. You'll notice there's a comment block at the top of the style.css file that determines the parent/template theme, as an example:

/*
 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
*/

You see in line in there Template: twentynineteen, that's telling your active theme to use that as a parent theme.

Now, I'm not familiar with Avada, but is it supposed to be a child theme of Twentynineteen? I don't believe so, but if it is, try reinstalling the twentynineteen theme. If it's not supposed to be, then make sure you don't have a Template: twentynineteen line in your style.css file.

If neither of those things work, you could also try replacing the get_template_{…}() functions with get_stylesheet_{…}() functions, but those would get reverted if/when you updated the theme.