我得到我的網頁上這樣的錯誤:WordPress的頭致命錯誤
Fatal error: Can't use function return value in write context in /home/shamsavh/public_html/wp-content/themes/bleute/header.php on line 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 }?>
這條線一定會_not_造成的錯誤,對不起。 – arkascha
的可能的複製:(http://stackoverflow.com/questions/1532693/weird-php-error-cant-use-function-return-value [奇怪的PHP錯誤「不能在寫上下文中使用函數返回值」] -in寫上下文) – Andreas
檢查最高投票的答案 – Andreas