Support » Theme: Zerif Lite » Undefined variable functions.php

  • Hi

    I get the following message on my site: Notice: Undefined variable: zerif_lite_sidebars in /home3/thougjk5/public_html/wp-content/themes/zeriflite_child/functions.php on line 17

    code:

    if ( empty ( $active_widgets[ $zerif_lite_sidebars['sidebar-ourfocus'] ] ) ):
    
    		$zerif_lite_counter = 1;

    The message appeared after I changed WP DEBUG to true in wp-config.php.

    Any help would be be appreciated.

    Thanks
    Simon

Viewing 1 replies (of 1 total)
  • That’s something in your child theme (which is called “zeriflite_child”, as shown in the error above). The lines themselves are valid—they’re also used in the main theme—but the main theme defines the variable $zerif_lite_sidebars properly before trying to use it.

    You’d get the same error if you wrote:

    if ( empty ( $ppp[ $qqq ] ) ) {
    }

    in your child theme’s functions.php. PHP doesn’t allow this.

    So the answer is to fix your child theme so that the variable is properly defined.

Viewing 1 replies (of 1 total)
  • The topic ‘Undefined variable functions.php’ is closed to new replies.