我在我的网页上收到此错误:
致命错误:无法在写入上下文中使用函数返回值 /home/shamsavh/public_html/wp-content/themes/bleute/header.php在线 35
第35行的代码是$header_setting = '';
。下面是详细的代码,有人可以帮忙吗?
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" <?php language_attributes(); ?>> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<!--[if lt IE 9]>
<script src="<?php echo esc_url( get_template_directory_uri() ); ?>/asset/js/html5.js"></script>
<![endif]-->
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="profile" href="http://gmpg.org/xfn/11" />
<?php wp_head();?>
</head>
<body <?php body_class(); ?>>
<div id="bleute-mobile-menu">
<button>
<i></i>
<i></i>
<i></i>
</button>
<?php wp_nav_menu( array( // show menu mobile
'theme_location' => 'mobile-menu',
'container' => 'nav',
'container_class' => 'mobile-menu'
) ); ?>
</div>
<?php
if (!is_404()) {
***$header_setting = '';***
$header_page_setting = get_post_meta( get_the_ID(), '_beautheme_custom_header', TRUE );
if (!empty(bleute_GetOption('header-type'))) {
$header_setting = bleute_GetOption('header-type');
}
if ($header_page_setting) {
$header_setting = $header_page_setting;
}
if (empty($header_setting)) {
$header_setting = 'none-slide';
}
if(is_search() == 'true'){
$header_setting = 'none-slide';
}
get_template_part('templates/header', $header_setting);
if (bleute_GetOption('enable-fixed') == '2') {
get_template_part('templates/header-stick', $header_setting);
}
?>
<?php }?>
答案 0 :(得分:0)
从第35行的代码中删除星号。这会导致PHP失败。转而来:
***$header_setting = '';***
到
$header_setting = '';