<?php if (!empty($input['font_changer'])) { //---text font changer---------- ?> <select class="font_changer font_search" id="<?php echo esc_attr($input_id); ?> _font" name="<?php echo esc_attr(THEME_OPTIONS); ?> [<?php echo esc_attr($input_id); ?> _font]"> <?php $fonts = get_google_fonts(); if (!empty($fonts)) { ?> <?php foreach ($fonts->items as $font) { ?> <option value='<?php echo esc_attr($font->family); ?> '<?php if ($font->family == $options[$input_id . "_font"]) { echo ' selected="selected"'; } ?> ><?php echo $font->family;
function google_fonts_add_head() { $google_webfonts = get_google_fonts(); $count = 1; $style = "<style type='text/css'>\n"; foreach ($google_webfonts as $fontname => $font) { $font = str_replace(' ', '+', $font); $style .= '@import url(http://fonts.googleapis.com/css?family=' . $font . ');' . "\n"; } $style .= "</style>"; echo $style; do_action('admin_print_styles'); }