• I keep getting this message when running my zerif lite child theme:

    Parse error: syntax error, unexpected T_FUNCTION in /websites/123reg/LinuxPackage23/no/vo/_u/novo.uk.com/public_html/wp-content/themes/zerif-pro-child/functions.php on line 9

    Which is this part:

    add_filter( 'pre_update_option_theme_mods_' . get_stylesheet(), function ( $value, $old_value ) {

    Whole php:

    <?php
    add_action( 'wp_enqueue_scripts', 'child_enqueue_styles',99);
    function child_enqueue_styles() {
        $parent_style = 'parent-style';
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    	 wp_enqueue_style( 'child-style',get_stylesheet_directory_uri() . '/custom.css', array( $parent_style ));
    }
    if ( get_stylesheet() !== get_template() ) {
        add_filter( 'pre_update_option_theme_mods_' . get_stylesheet(), function ( $value, $old_value ) {
             update_option( 'theme_mods_' . get_template(), $value );
             return $old_value; // prevent update to child theme mods
        }, 10, 2 );
        add_filter( 'pre_option_theme_mods_' . get_stylesheet(), function ( $default ) {
            return get_option( 'theme_mods_' . get_template(), $default );
        } );
    }
    ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    I set the site up on a dev site, and it worked fine. Moved it now getting this error code

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Zerif lite child theme error’ is closed to new replies.