Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

How can I load Google Fonts in the header which users have selected?

Open shaonsina opened this issue 8 years ago • 2 comments

I've expanded some options for nivo-slider where users could be choosing Google fonts. But the problem is how can I load Google Fonts in the header which users have selected?

shaonsina avatar Jun 04 '18 16:06 shaonsina

You can create a function for that: `if(!function_exists('_action_theme_process_google_fonts')) { function _action_theme_process_google_fonts() { $include_from_google = array(); $google_fonts = fw_get_google_fonts();

    $your_typography_option_1 = fw_get_db_settings_option('your_typography_option_1');
    $your_typography_option_2 = fw_get_db_settings_option('your_typography_option_2');

    // if is google font
    if( isset($google_fonts[$your_typography_option_1['family']]) ){
        $include_from_google[$your_typography_option_1['family']] =   $google_fonts[$your_typography_option_1['family']];
    }

    if( isset($google_fonts[$your_typography_option_1['family']]) ){
        $include_from_google[$your_typography_option_2['family']] =   $google_fonts[$your_typography_option_2['family']];
    }

    $google_fonts_links = fw_theme_get_remote_fonts($include_from_google);
    // set a option in db for save google fonts link
    update_option( 'fw_theme_google_fonts_link', $google_fonts_links );
}
add_action('fw_settings_form_saved', '_action_theme_process_google_fonts', 999, 2);

}`

You can refer it here https://github.com/ThemeFuse/Unyson/issues/433

jonmlas avatar Jun 06 '18 04:06 jonmlas

Please read here: #2384

ViorelEremia avatar Jun 11 '18 13:06 ViorelEremia