-4

I'm getting this error on my page:

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

The code at line 35 is $header_setting = '';. Below is detailed code, can someone please help?

    <!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 }?>
James Jones
  • 3,850
  • 5
  • 25
  • 44
  • That line certainly will _not_ cause that error, sorry. – arkascha Oct 27 '16 at 10:36
  • 1
    Possible duplicate of [Weird PHP error: 'Can't use function return value in write context'](http://stackoverflow.com/questions/1532693/weird-php-error-cant-use-function-return-value-in-write-context) – Andreas Oct 27 '16 at 10:40
  • Check the highest voted answer – Andreas Oct 27 '16 at 10:40
  • `!empty(bleute_GetOption('header-type'))` is the part which is failing. That is line 35 by my count, not `$header_setting = '';`. @Andreas is pointing you to the correct solution I think, but did not mention this. – James Jones Oct 27 '16 at 10:44

1 Answers1

0

Remove the asterisks from around the code in line 35. These will cause PHP to fail. So turn:

***$header_setting = '';***

to

$header_setting = '';
James Jones
  • 3,850
  • 5
  • 25
  • 44