php error instead of custom 404 page
Hi,
I set up a custom 404 page using the built-in 404 page in the theme settings. It was working perfectly for a while, but now, it has started displaying a php error instead of the error page itself.
Here is what I get now instead of the error page.
"
Fatal error: Uncaught Error: Call to undefined function
mfn_builder_print() in
/hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/wp-content/themes/betheme-child/404.php:61
Stack trace:
#0
/hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/wp-includes/template-loader.php(77):
include()
#1
/hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/wp-blog-header.php(19):
require_once('/hermes/walnawe...')
#2 /hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/index.php(17):
require('/hermes/walnawe...')
#3 {main}
thrown in
/hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/wp-content/themes/betheme-child/404.php
on line 61
Fatal error: Uncaught Error: Call to undefined function
mfn_builder_print() in
/hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/wp-content/themes/betheme-child/404.php:61
Stack trace:
#0
/hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/wp-includes/template-loader.php(77):
include()
#1
/hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/wp-blog-header.php(19):
require_once('/hermes/walnawe...')
#2 /hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/index.php(17):
require('/hermes/walnawe...')
#3 {main}
thrown in
/hermes/walnaweb06a/b2072/moo.jmhoffman/advancedir/wp-content/themes/betheme-child/404.php
on line 61
"
Can you please help me get my 404 error page working again?
Here is the link to the site:
and here is the link that caused the error code to appear (although it appears for any incorrect page url)
Comments
Now, if you will make some changes in your child theme, you don't have to
provide the informations in functions.php which files you changed - now,
it's automatically apply these changes.
To make your Child Theme work again, you have to find and replace the 'mfn_opts_show()' to 'echo mfn_opts_get()' in files which were modified.
After that, everything should be working fine, we had to make that change because of the new envato rules, more about it here: https://help.author.envato.com/hc/en-us/articles/360000481243#h_674316188621522302914837
'mfn_opts_show()' to 'echo mfn_opts_get()' in files which were modified.
/**
* 404 page.
*
* @package Betheme
* @author Muffin group
* @link https://muffingroup.com
*/
$translate['404-title'] = mfn_opts_get('translate') ? mfn_opts_get('translate-404-title', 'Ooops... Error 404') : __('Ooops... Error 404', 'betheme');
$translate['404-subtitle'] = mfn_opts_get('translate') ? mfn_opts_get('translate-404-subtitle', 'We are sorry, but the page you are looking for does not exist') : __('We are sorry, but the page you are looking for does not exist', 'betheme');
$translate['404-text'] = mfn_opts_get('translate') ? mfn_opts_get('translate-404-text', 'Please check entered address and try again or') : __('Please check entered address and try again or ', 'betheme');
$translate['404-btn'] = mfn_opts_get('translate') ? mfn_opts_get('translate-404-btn', 'go to homepage') : __('go to homepage', 'betheme');
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js<?php echo esc_attr(mfn_user_os()); ?>">
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<?php
if (mfn_opts_get('responsive')) {
if (mfn_opts_get('responsive-zoom')) {
echo '<meta name="viewport" content="width=device-width, initial-scale=1" />';
} else {
echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />';
}
}
?>
<?php do_action('wp_seo'); ?>
<link rel="shortcut icon" href="<?php echo esc_url(mfn_opts_get('favicon-img', get_theme_file_uri('/images/favicon.ico'))); ?>" type="image/x-icon" />
<?php wp_head();?>
</head>
<?php
$customID = mfn_opts_get('error404-page');
$body_class = '';
if ($customID) {
$body_class .= 'custom-404';
}
?>
<body <?php body_class($body_class); ?>>
<?php if ($customID): ?>
<?php
get_header();
?>
<div id="Content">
<div class="content_wrapper clearfix">
<div class="sections_group">
<?php mfn_builder_print($customID, true); ?>
</div>
<?php get_sidebar(); ?>
</div>
</div>
<?php else: ?>
<div id="Error_404">
<div class="container">
<div class="column one">
<div class="error_pic">
<i class="<?php echo esc_attr(mfn_opts_get('error404-icon', 'icon-traffic-cone')); ?>"></i>
</div>
<div class="error_desk">
<h2><?php echo esc_html($translate['404-title']); ?></h2>
<h4><?php echo esc_html($translate['404-subtitle']); ?></h4>
<p><span class="check"><?php echo wp_kses_post($translate['404-text']); ?></span> <a class="button button_filled" href="<?php echo esc_url(site_url()); ?>"><?php echo esc_html($translate['404-btn']); ?></a></p>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php wp_footer(); ?>
</body>
</html>