'Arial', '"Avant Garde", sans-serif' => 'Avant Garde', 'Cambria, Georgia, serif' => 'Cambria', 'Copse, sans-serif' => 'Copse', 'Garamond, "Hoefler Text", Times New Roman, Times, serif' => 'Garamond', 'Georgia, serif' => 'Georgia', '"Helvetica Neue", Helvetica, sans-serif' => 'Helvetica Neue', 'Tahoma, Geneva, sans-serif' => 'Tahoma' ); return $os_faces; } /** * Returns a select list of Google fonts * Feel free to edit this, update the fallbacks, etc. */ function options_typography_get_google_fonts() { // Google Font Defaults $google_faces = array( 'Arvo, serif' => 'Arvo', 'Copse, sans-serif' => 'Copse', 'Droid Sans, sans-serif' => 'Droid Sans', 'Droid Serif, serif' => 'Droid Serif', 'Lobster, cursive' => 'Lobster', 'Nobile, sans-serif' => 'Nobile', 'Open Sans, sans-serif' => 'Open Sans', 'Oswald, sans-serif' => 'Oswald', 'Pacifico, cursive' => 'Pacifico', 'Rokkitt, serif' => 'Rokkit', 'PT Sans, sans-serif' => 'PT Sans', 'Quattrocento, serif' => 'Quattrocento', 'Raleway, cursive' => 'Raleway', 'Ubuntu, sans-serif' => 'Ubuntu', 'Yanone Kaffeesatz, sans-serif' => 'Yanone Kaffeesatz' ); return $google_faces; } /* * Returns a typography option in a format that can be outputted as inline CSS */ function options_typography_font_styles($option, $selectors) { $output = $selectors . ' {'; $output .= ' color:' . $option['color'] .'; '; $output .= 'font-family:' . $option['face'] . '; '; $output .= 'font-weight:' . $option['style'] . '; '; $output .= 'font-size:' . $option['size'] . '; '; $output .= '}'; $output .= "\n"; return $output; } /** * Checks font options to see if a Google font is selected. * If so, options_typography_enqueue_google_font is called to enqueue the font. * Ensures that each Google font is only enqueued once. */ if ( !function_exists( 'options_typography_google_fonts' ) ) { 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 $logo_text = of_get_option('logo_text', 'Oswald, serif'); $logo_desc = of_get_option('logo_desc', 'Oswald, serif'); $menu_font = of_get_option('menu_font', 'Oswald, serif'); $body_font = of_get_option('body_font', 'Oswald, serif'); $title_font = of_get_option('title_font', 'Oswald, serif'); $sidebar_title_font = of_get_option('sidebar_title_font', 'Oswald, serif'); $sidebar_link_font = of_get_option('sidebar_link_font', 'Oswald, serif'); $links_font = of_get_option('links_font', 'Oswald, serif'); $footer_titles_font = of_get_option('footer_titles_font', 'Oswald, serif'); $footer_links_font = of_get_option('footer_links_font', 'Oswald, serif'); $footer_text_font = of_get_option('footer_text_font', 'Oswald, serif'); // Get the font face for each option and put it in an array $selected_fonts = array( $logo_text['face'], $logo_desc['face'], $menu_font['face'], $body_font['face'], $body_font['face'], $title_font['face'], $sidebar_title_font['face'], $sidebar_link_font['face'], $links_font['face'], $footer_titles_font['face'], $footer_links_font['face'], $footer_text_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); } } } } add_action( 'wp_enqueue_scripts', 'options_typography_google_fonts' ); /** * Enqueues the Google $font that is passed */ function options_typography_enqueue_google_font($font) { $font = explode(',', $font); $font = $font[0]; // Certain Google fonts need slight tweaks in order to load properly // Like our friend "Raleway" if ( $font == 'Raleway' ) $font = 'Raleway:100'; $font = str_replace(" ", "+", $font); wp_enqueue_style( "options_typography_$font", "http://fonts.googleapis.com/css?family=$font", false, null, 'all' ); } if (!function_exists('avrora_setup')) : function avrora_setup() { global $content_width; if (!isset($content_width)) { $content_width = 1014; } load_theme_textdomain( 'booster', get_template_directory() . '/languages' ); register_nav_menu('primary', __('Top Menu', "avrora")); add_theme_support('automatic-feed-links'); add_theme_support('post-thumbnails'); add_theme_support('custom-background'); $custom_header_support = array( 'default-text-color' => '000', 'flex-height' => true, ); set_post_thumbnail_size(150, 150, true); add_image_size('small-home', 282, 187); } endif; add_action('after_setup_theme', 'avrora_setup'); if ( ! function_exists( 'avrora_paginate_page' ) ) : function indigos_paginate_page() { wp_link_pages( array( 'before' => '