我正在将教会网站PHP从5.2更新到7.2,并且在网站上和Wordpress中都收到错误消息。这是现场错误:
警告:在/nfs/c05/h03/mnt/75123/domains/villanovabaptist.com/html/wp-中使用未定义的常量样式-假定为“样式”(这会在PHP的未来版本中引发错误)第19行的content / themes / zion / functions / admin-setup.php
和
警告:/unfs/c05/h03/mnt/75123/domains/villanovabaptist.com/html/wp-中使用未定义的恒定教堂主题-假定为“教堂主题”(这将在PHP的未来版本中引发错误)在第87行上的content / themes / zion / functions / admin-setup.php
我对PHP不太了解,所以我没有尝试过任何东西。
这是上面的错误中引用的代码。
<?php
// Options panel stylesheet
function churchthemes_admin_head() {
echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/functions/admin-style.css" media="screen" />';
}
// Load different stylesheet
function churchthemes_wp_head() {
//Styles
$style = $_REQUEST[style];
if ($style != '') {
echo '<link href="'. get_bloginfo('template_directory') .'/styles/'. $style . '.css" rel="stylesheet" />'."\n";
} else {
$stylesheet = get_option('church_alt_stylesheet');
if($stylesheet != ''){
echo '<link href="'. get_bloginfo('template_directory') .'/styles/'. $stylesheet .'" rel="stylesheet" />'."\n";
}
}
// Custom.css insert
echo '<link href="'. get_bloginfo('template_directory') .'/custom.css" rel="stylesheet" type="text/css" />'."\n";
// Favicon
if(get_option('church_custom_favicon') != ''){
echo '<link rel="shortcut icon" href="'. get_option('church_custom_favicon') .'"/>'."\n";
}
// Custom CSS block in Backend
$custom_css = get_option('church_custom_css');
if($custom_css != '')
{
$output = '<style type="text/css">'."\n";
$output .= $custom_css . "\n";
$output .= '</style>'."\n";
echo $output;
}
//Decode
$decode = $_REQUEST['decode'];
if ($decode == 'true')
church_option_output();
// Localization
load_theme_textdomain(churchthemes);
}
// Add Encrypted setting field to footer for debug purposes
function church_option_output(){
$data = get_option('church_settings_encode');
echo '<meta name="generator" content="' . $data . '" />';
}
// Use legacy comments on versions before WP 2.7
add_filter('comments_template', 'legacy_comments');
function legacy_comments($file) {
if(!function_exists('wp_list_comments')) : // WP 2.7-only check
$file = TEMPLATEPATH . '/comments-legacy.php';
endif;
return $file;
}
?>