yanknudtskov
6/19/2016 - 3:31 PM

optimize.php

<?php

/**
* Remove Enfold Google Web Fonts
*/
add_action( 'init', 'enfold_customization_switch_fonts' );
function enfold_customization_switch_fonts() {
  global $avia;
  $avia->style->print_extra_output = false;
}

/**
* Enqueue Google Web Fonts in Footer
*/
function yanco_footer_scripts() {
  if( !is_admin() ) {
    $query_args = array(
    'family' => 'Lato:300,400,700|Open+Sans:400,700',
    'subset' => 'latin,latin-ext',
    );
  
    wp_register_style( 'yanco-google-fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null );
    wp_enqueue_style('yanco-google-fonts' );
  }
}
add_action( 'wp_footer', 'yanco_footer_scripts' );

/**
* Remove Google Fonts from Monarch
*/
function yanco_et_monarch_disable_fonts() {
  wp_dequeue_style( 'et-gf-open-sans' );
}
add_action( 'wp_enqueue_scripts', 'yanco_et_monarch_disable_fonts', 99 );