Error Message: Can’t use Function Return value in write context in

Asked

Viewed 3,801 times

-1

I’m getting the following error

Fatal error: Can’t use Function Return value in write context in C: Windows iwpserver htdocs wordpress wp-content themes usagistream index.php on line 17

the index file has this code

<?php

/**

 * theme from 

 * version 1.0

 */

get_header(); ?>

    <?php

    if (is_front_page() and is_home() ):

    if(!empty(get_option('config_infoweb'))){

    echo '<div id="site-info">';

    echo '<p>',get_option('config_infoweb'),'</p>';

    echo '</div>';

    }

    endif;

    ?>

    <?php if (is_front_page() and is_home() ):  echo '<h3 class="main-title">Recent Post</h3>'; endif;?>

    <section class="page-index site-index row-flex row">

    <?php

        if ( have_posts() ) :

            // Start the Loop.

        while ( have_posts() ) : the_post();

            /*

             * Include the post format-specific template for the content. If you want to

             * use this in a child theme, then include a file called called content-___.php

             * (where ___ is the post format) and that will be used instead.

             */

            get_template_part( 'content' );

        endwhile;

        else :

            // If no content, include the "No posts found" template.

            get_template_part( 'content', 'none' );

        endif;

    ?>

    <div class="clear"></div>

    </section>

    <?php

            // Previous/next post navigation.

            numeric_posts_nav();

    ?>

    <?php if(is_front_page() and is_home()) : ?>

    <section class='anime-index'>

    <?php if(is_active_sidebar('main-widget')) : ?>

    <?php dynamic_sidebar( 'main-widget' ); ?>

    <?php elseif ( is_user_logged_in() ): ?>

    <div class="site-error">

        <div class="fa fa-warning"></div>

        <strong>No Widgets Assigned.</strong>

        <a href="<?php echo admin_url(); ?>widgets.php" class="btn btn-round">Go to Widgets</a>

    </div>

    <?php endif; ?>

    </section>

    <?php endif; ?>

<?php

get_sidebar();

get_footer();

?>

php header file

<!DOCTYPE html>

<html <?php language_attributes(); ?> class="no-js">

<head>

    <title><?php wp_title( '|', true, 'right' ); ?></title>

    <meta charset="<?php bloginfo( 'charset' ); ?>">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="profile" href="http://gmpg.org/xfn/11">

    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

    <?php wp_head(); ?>

</head>



<body <?php body_class(); ?> >

<div id="fb-root"></div>

<script>(function(d, s, id) {

  var js, fjs = d.getElementsByTagName(s)[0];

  if (d.getElementById(id)) return;

  js = d.createElement(s); js.id = id;

  js.src = "//connect.facebook.net/id_ID/sdk.js#xfbml=1&version=v2.8";

  fjs.parentNode.insertBefore(js, fjs);

}(document, 'script', 'facebook-jssdk'));</script>

    <div id="header-wrapper" class="container">

    <header id="header" class="site-header" role="banner">

        <div class="site-branding">

            <?php if ( get_theme_mod( 'usagsilabs_logo' ) ) : ?>

            <?php if(is_home() || is_front_page()) {?>

                <h1 id="logo" class="site-logo">

                    <a href='<?php echo esc_url( home_url( '/' ) ); ?>' title='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>' rel='home'>

                        <img src='<?php echo esc_url( get_theme_mod( 'usagsilabs_logo' ) ); ?>' alt='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>'>

                    </a>

                </h1>

            <?php } else { ?>

                <p id="logo" class="site-logo">

                    <a href='<?php echo esc_url( home_url( '/' ) ); ?>' title='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>' rel='home'>

                        <img src='<?php echo esc_url( get_theme_mod( 'usagsilabs_logo' ) ); ?>' alt='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>'>

                    </a>

                </p>

            <?php } ?>

            <?php else : ?>

            <?php if(is_home() || is_front_page()) {?>

                <h1 id="blog-title" class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name');?></a></h1>

            <?php } else { ?>

                <p id="blog-title" class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name');?></a></p>

            <?php } ?>

                <p id="blog-description" class='site-description'><?php echo get_bloginfo('description');?></p>

            <?php endif; ?>

        </div>

    <div class='clear'></div>

    </header><!-- #header -->

    <nav id="site-navigation" class="site-navigation cl" role="navigation">

        <input class='dn' id='mb_put' type='checkbox'/>

        <label class='dn' id='mb_lab'><i class='fa fa-bars'></i> Navigation</label>

        <?php wp_nav_menu( array('theme_location' => 'primary', 'fallback_cb' => 'fallback_menu' ) ); ?>

        <?php usagilabs_search() ?>

        <div class="clear"></div>

    </nav><!-- site-navigation -->

    <div id="recomended">

        <?php usagilabs_recomended() ?>

    </div>

    </div>



    <div id="page" class="hfeed site container">



<div id="content" class="site-content">

    <?php if (is_front_page() and is_home() ): usagilabs_hotupdate(); endif;?>

    <main id="main" class="site-main col-md-8 col-sm-8 col-xs-12 col-mb-12" role="main">

1 answer

0

You must be using an older version of PHP in which empty only accepts variables, not function returns.

change:

if(!empty(get_option('config_infoweb'))){

for

$config_infoweb = get_option('config_infoweb');
if(!empty($config_infoweb)){
  • Thanks for the reply, but now appeared part of the theme with the following error, Fatal error: Call to Undefined Function usagilabs_search() in iwpserver htdocs wordpress wp-content themes usagistream header.php on line 107

  • php header file is attached in edited post

Browser other questions tagged

You are not signed in. Login or sign up in order to post.