function options_typography_google_fonts() { global $data; $customfont = ''; $default = array('arial', 'verdana', 'trebuchet', 'georgia', 'times', 'tahoma', 'helvetica'); $googlefonts = array($data['font_body']['face'], $data['font_h1']['face'], $data['font_h2']['face'], $data['font_h3']['face'], $data['font_h4']['face'], $data['font_h5']['face'], $data['font_h6']['face'], $data['font_titleh1']['face'], $data['font_titleh2']['face'], $data['font_titleimgh1']['face'], $data['font_titleimg2h1']['face'], $data['font_titleimgh2']['face'], $data['font_nav']['face'], $data['font_footerheading']['face'], $data['font_sidebarwidget']['face'], $data['font_slogan']['face']); // Remove any duplicates in the list $googlefonts = array_unique($googlefonts); // Check Google Fonts against System Fonts & Call Enque Font foreach ($googlefonts as $getfonts) { if (!in_array($getfonts, $default)) { options_typography_enqueue_google_font($getfonts); } } }
function options_typography_google_fonts() { $all_google_fonts = array_keys(options_typography_get_google_fonts()); // Define all the options that possibly have a unique Google font $google_font = of_get_option('google_font', 'Rokkitt, serif'); $google_mixed = of_get_option('google_mixed', false); $google_mixed_2 = of_get_option('google_mixed_2', 'Arvo, serif'); // Get the font face for each option and put it in an array $selected_fonts = array($google_font['face'], $google_mixed['face'], $google_mixed_2['face']); // Remove any duplicates in the list $selected_fonts = array_unique($selected_fonts); // Check each of the unique fonts against the defined Google fonts // If it is a Google font, go ahead and call the function to enqueue it foreach ($selected_fonts as $font) { if (in_array($font, $all_google_fonts)) { options_typography_enqueue_google_font($font); } } }
function options_typography_google_fonts() { $all_google_fonts = array_keys(options_typography_get_google_fonts()); // Define all the options that possibly have a unique Google font $site_title_font = of_get_option('site_title_font', 'Open Sans, sans-serif'); $headings = of_get_option('heading_font', false); $navigation = of_get_option('navigation', false); $body_font = of_get_option('body_font', false); $widget_title_font = of_get_option('widget_title_font', false); // Get the font face for each option and put it in an array $selected_fonts = array($site_title_font['face'], $headings['face'], $navigation['face'], $body_font['face'], $widget_title_font['face']); // Remove any duplicates in the list $selected_fonts = array_unique($selected_fonts); // Check each of the unique fonts against the defined Google fonts // If it is a Google font, go ahead and call the function to enqueue it foreach ($selected_fonts as $font) { if (in_array($font, $all_google_fonts)) { options_typography_enqueue_google_font($font); } } }
function options_typography_google_fonts() { global $font_array, $char_array; $all_google_fonts = array_keys(options_typography_get_google_fonts()); $all_character_sets = array_keys(of_recognized_font_characters()); // Define all the options that possibly have a unique Google font $h1_heading = of_get_option('h1_heading', 'Arial'); $h2_heading = of_get_option('h2_heading', 'Arial'); $h3_heading = of_get_option('h3_heading', 'Arial'); $h4_heading = of_get_option('h4_heading', 'Arial'); $h5_heading = of_get_option('h5_heading', 'Arial'); $h6_heading = of_get_option('h6_heading', 'Arial'); $google_mixed_3 = of_get_option('google_mixed_3', 'Rokkitt, serif'); if (of_get_option('logo_typography')) { $logo_typography = of_get_option('logo_typography'); } if (of_get_option('menu_typography')) { $menu_typography = of_get_option('menu_typography', 'Arial'); } if (of_get_option('footer_menu_typography')) { $footer_menu_typography = of_get_option('footer_menu_typography', 'Arial'); } // Get the font face for each option and put it in an array if (isset($h1_heading) && is_array($h1_heading)) { $selected_fonts['h1_heading'] = $h1_heading['face']; } if (isset($h2_heading) && is_array($h2_heading)) { $selected_fonts['h2_heading'] = $h2_heading['face']; } if (isset($h3_heading) && is_array($h3_heading)) { $selected_fonts['h3_heading'] = $h3_heading['face']; } if (isset($h4_heading) && is_array($h4_heading)) { $selected_fonts['h4_heading'] = $h4_heading['face']; } if (isset($h5_heading) && is_array($h5_heading)) { $selected_fonts['h5_heading'] = $h5_heading['face']; } if (isset($h6_heading) && is_array($h6_heading)) { $selected_fonts['h6_heading'] = $h6_heading['face']; } if (isset($google_mixed_3) && is_array($google_mixed_3)) { $selected_fonts['google_mixed_3'] = $google_mixed_3['face']; } if (isset($logo_typography) && is_array($logo_typography)) { $selected_fonts['logo_typography'] = $logo_typography['face']; } if (isset($menu_typography) && is_array($menu_typography)) { $selected_fonts['menu_typography'] = $menu_typography['face']; } if (isset($footer_menu_typography) && is_array($footer_menu_typography)) { $selected_fonts['footer_menu_typography'] = $footer_menu_typography['face']; } if (isset($h1_heading) && is_array($h1_heading)) { $selected_character['h1_heading'] = $h1_heading['character']; } if (isset($h2_heading) && is_array($h2_heading)) { $selected_character['h2_heading'] = $h2_heading['character']; } if (isset($h3_heading) && is_array($h3_heading)) { $selected_character['h3_heading'] = $h3_heading['character']; } if (isset($h4_heading) && is_array($h4_heading)) { $selected_character['h4_heading'] = $h4_heading['character']; } if (isset($h5_heading) && is_array($h5_heading)) { $selected_character['h5_heading'] = $h5_heading['character']; } if (isset($h6_heading) && is_array($h6_heading)) { $selected_character['h6_heading'] = $h6_heading['character']; } if (isset($google_mixed_3) && is_array($google_mixed_3)) { $selected_character['google_mixed_3'] = $google_mixed_3['character']; } if (isset($logo_typography) && is_array($logo_typography)) { $selected_character['logo_typography'] = $logo_typography['character']; } if (isset($menu_typography) && is_array($menu_typography)) { $selected_character['menu_typography'] = $menu_typography['character']; } if (isset($footer_menu_typography) && is_array($footer_menu_typography)) { $selected_character['footer_menu_typography'] = $footer_menu_typography['character']; } if (isset($selected_fonts) && !empty($selected_fonts)) { // Remove any duplicates in the list $selected_fonts = array_unique($selected_fonts); // Check each of the unique fonts against the defined Google fonts // If it is a Google font, go ahead and call the function to enqueue it foreach ($selected_fonts as $key => $font) { if (in_array($font, $all_google_fonts)) { options_typography_enqueue_google_font($key, $font); } } } // $selected_character = array_unique($selected_character); if (isset($selected_character) && !empty($selected_character)) { foreach ($selected_character as $key => $character) { if (in_array($character, $all_character_sets)) { options_typography_enqueue_google_character_set($key, $character); } } } if (isset($font_array)) { foreach ($font_array as $key => $value) { switch ($font_array[$key]) { case 'Open+Sans+Condensed': $font_array[$key] = $font_array[$key] . ':300'; break; default: // break; } options_typography_enqueue_google_fonts($font_array[$key], $char_array[$key]); } } }
function options_typography_google_fonts() { $all_google_fonts = array_keys(options_typography_get_google_fonts()); global $options; $body = $options['body_font']; $navigation = $options['navigation_font']; $navigation_dropdown = $options['navigation_dropdown_font']; $nectar_slider_heading = $options['nectar_slider_heading_font']; $home_slider_caption = $options['home_slider_caption_font']; $testimonial = $options['testimonial_font']; $page_heading = $options['page_heading_font']; $page_heading_subtitle = $options['page_heading_subtitle_font']; $h1 = $options['h1_font']; $h2 = $options['h2_font']; $h3 = $options['h3_font']; $h4 = $options['h4_font']; $h5 = $options['h5_font']; $italic = $options['i_font']; $sidebar_carousel_footer_header = $options['sidebar_footer_h_font']; $team_member_names = $options['team_member_h_font']; //$google_mixed = of_get_option('google_mixed', false); //$google_mixed_2 = of_get_option('google_mixed_2', 'Arvo, serif'); // Get the font face for each option and put it in an array $selected_fonts = array($body, $navigation, $navigation_dropdown, $nectar_slider_heading, $home_slider_caption, $testimonial, $page_heading, $page_heading_subtitle, $h1, $h2, $h3, $h4, $h5, $italic, $sidebar_carousel_footer_header, $team_member_names); $locations = array('body_font', 'navigation_font', 'navigation_dropdown_font', 'nectar_slider_heading_font', 'home_slider_caption_font', 'testimonial_font', 'page_heading_font', 'page_heading_subtitle_font', 'h1_font', 'h2_font', 'h3_font', 'h4_font', 'h5_font', 'i_font', 'sidebar_footer_h_font', 'team_member_h_font'); // Remove any duplicates in the list //$selected_fonts = array_unique($selected_fonts); // Check each of the unique fonts against the defined Google fonts // If it is a Google font, go ahead and call the function to enqueue it $count = 0; foreach ($selected_fonts as $font) { if (in_array($font, $all_google_fonts)) { options_typography_enqueue_google_font($font, $locations[$count]); } //custom included fonts if ($font == 'Lovelo, sans-serif') { if (!function_exists('nectar_lovelo_font')) { function nectar_lovelo_font() { echo "\n\t\t\t\t\t\t<!-- A font fabric font - http://fontfabric.com/lovelo-font/ -->\n\t\t\t\t\t\t<style> @font-face { font-family: 'Lovelo'; src: url('" . get_template_directory_uri() . "/css/fonts/Lovelo_Black.eot'); src: url('" . get_template_directory_uri() . "/css/fonts/Lovelo_Black.eot?#iefix') format('embedded-opentype'), url('" . get_template_directory_uri() . "/css/fonts/Lovelo_Black.woff') format('woff'), url('" . get_template_directory_uri() . "/css/fonts/Lovelo_Black.ttf') format('truetype'), url('" . get_template_directory_uri() . "/css/fonts/Lovelo_Black.svg#loveloblack') format('svg'); font-weight: normal; font-style: normal; } </style>"; } } add_action('wp_head', 'nectar_lovelo_font'); } $count++; } }
function options_typography_google_fonts() { $all_google_fonts = array_keys(options_typography_get_google_fonts()); // Define all the options that possibly have a unique Google font $typography_body = of_get_option('typography_body', array('size' => '12px', 'face' => 'Arial, Helvetica, sans-serif', 'style' => 'normal', 'color' => '#919090')); $typography_menu = of_get_option('typography_menu', array('size' => '14px', 'face' => 'Kavoon', 'style' => 'normal', 'color' => '#70b3d0')); $typography_heading = of_get_option('typography_heading', array('face' => 'Kavoon', 'style' => 'normal', 'color' => '#70b3d0')); $typography_h1 = of_get_option('typography_h1', array('size' => '32px', 'face' => 'Kavoon', 'style' => 'normal', 'color' => '#70b3d0')); $typography_h2 = of_get_option('typography_h2', array('size' => '24px', 'face' => 'Kavoon', 'style' => 'normal', 'color' => '#70b3d0')); $typography_h3 = of_get_option('typography_h3', array('size' => '18px', 'face' => 'Kavoon', 'style' => 'normal', 'color' => '#70b3d0')); $typography_h4 = of_get_option('typography_h4', array('size' => '16px', 'face' => 'Kavoon', 'style' => 'normal', 'color' => '#70b3d0')); $typography_h5 = of_get_option('typography_h5', array('size' => '14px', 'face' => 'Kavoon', 'style' => 'normal', 'color' => '#70b3d0')); $typography_h6 = of_get_option('typography_h6', array('size' => '12px', 'face' => 'Kavoon', 'style' => 'normal', 'color' => '#70b3d0')); // Get the font face for each option and put it in an array $selected_fonts = array($typography_body['face'], $typography_menu['face'], $typography_heading['face'], $typography_h1['face'], $typography_h2['face'], $typography_h3['face'], $typography_h4['face'], $typography_h5['face'], $typography_h6['face']); // Remove any duplicates in the list $selected_fonts = array_unique($selected_fonts); // Check each of the unique fonts against the defined Google fonts // If it is a Google font, go ahead and call the function to enqueue it foreach ($selected_fonts as $font) { if (in_array($font, $all_google_fonts)) { options_typography_enqueue_google_font($font); } } }
function options_typography_google_fonts() { $all_google_fonts = array_keys(options_typography_get_google_fonts()); global $options; $body = $options['body_font']; $navigation = $options['navigation_font']; $navigation_dropdown = $options['navigation_dropdown_font']; $nectar_slider_heading = $options['nectar_slider_heading_font']; $home_slider_caption = $options['home_slider_caption_font']; $standard_header = $options['standard_h_font']; $sidebar_carousel_footer_header = $options['sidebar_footer_h_font']; $team_member_names = $options['team_member_h_font']; //$google_mixed = of_get_option('google_mixed', false); //$google_mixed_2 = of_get_option('google_mixed_2', 'Arvo, serif'); // Get the font face for each option and put it in an array $selected_fonts = array($body, $navigation, $navigation_dropdown, $nectar_slider_heading, $home_slider_caption, $standard_header, $sidebar_carousel_footer_header, $team_member_names); $locations = array('body_font', 'navigation_font', 'navigation_dropdown_font', 'nectar_slider_heading_font', 'home_slider_caption_font', 'standard_h_font', 'sidebar_footer_h_font', 'team_member_h_font'); // Remove any duplicates in the list //$selected_fonts = array_unique($selected_fonts); // Check each of the unique fonts against the defined Google fonts // If it is a Google font, go ahead and call the function to enqueue it $count = 0; foreach ($selected_fonts as $font) { if (in_array($font, $all_google_fonts)) { options_typography_enqueue_google_font($font, $locations[$count]); } $count++; } }