• In my theme’s (Avada) functions.php file there is some code that is not contained within a function. For example:

    // Initialize social icons setup
    require_once( get_template_directory() . '/framework/class-social-icons.php' );
    global $social_icons;
    $social_icons = new Avada_SocialIcons();

    I’d like to remove unnecessary code from functions.php to increase performance. How do I do this when this code is not wrapped up in a function?

Viewing 1 replies (of 1 total)
  • The code you posted above is probably not unnecessary unless you are trying to break your theme.

    Try doing this to Avada’s function.php and embrace the chaos:

    // Initialize social icons setup
    //require_once( get_template_directory() . '/framework/class-social-icons.php' );
    //global $social_icons;
    //$social_icons = new Avada_SocialIcons();

Viewing 1 replies (of 1 total)
  • The topic ‘How to override functions.php code that is not wrapped up in a function’ is closed to new replies.