Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you made no edits to the functions.php file when you created your child theme, then yes it is safe to replace all the code in the functions.php file with the code above. I didn’t write this code — it was auto-generated when I created a child theme with a plugin. The reason you have to change the functions.php code for this update is cause the update changed some code in the functions.php file.

    Just remember to save a backup of the functions.php file just in case anything goes wrong.

    Thanks and hope you are doing well during this crazy time.

    Hi @aderobinson,
    I also have a child theme of Hitmag 1.27. It did break my site but I managed to fix it after I modified the child theme’s functions.php file. The new update changed some function.php code so you have to change it too in your child theme:

    <?php
    // Exit if accessed directly
    if (!defined('ABSPATH'))
        exit;
    
    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below:
    
    if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
        function chld_thm_cfg_locale_css( $uri ){
            if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
                $uri = get_template_directory_uri() . '/rtl.css';
            return $uri;
        }
    endif;
    add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
    
    if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
        function chld_thm_cfg_parent_css() {
            wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( 'hitmag-font-awesome' ) );
        }
    endif;
    add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
    
    // END ENQUEUE PARENT ACTION
    
Viewing 2 replies - 1 through 2 (of 2 total)