function font_head() { $other = get_option('other_options'); $fonts = Metrika_google_fonts(); $body_key = 'open_sans'; if ($other['font']) { $body_key = $other['font']; } if (isset($fonts[$body_key])) { $body_font = $fonts[$body_key]; echo '<style>'; echo $body_font['font']; echo 'body, .container, .quotation, footer, h1, h2, h3, h4, h5, h6, a, a:active, a:visited, #site-navigation .menu > li a, #site-navigation .menu > ul li a, #secondary aside h1, #secondary aside a, #primary .recentcomments, #primary article, #primary article .entry-content, h2.comments-title, #primary .comment-form p, #primary *, .gridster li .title{ ' . $body_font['css'] . ' }; '; echo '</style>'; } }
/** * Add postMessage support for site title and description for the Theme Customizer. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ function Metrika_customize_register($wp_customize) { $fonts = Metrika_google_fonts(); $font_list = array(); foreach ($fonts as $key => $value) { $font_list[$key] = $value['name']; } $wp_customize->get_setting('blogname')->transport = 'postMessage'; $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; $wp_customize->get_setting('header_textcolor')->transport = 'postMessage'; $wp_customize->remove_section('title_tagline'); $wp_customize->remove_section('static_front_page'); $wp_customize->remove_section('nav'); $wp_customize->add_section('metrika_color', array('title' => __('Default Theme Color', 'metrika'), 'priority' => 5)); $wp_customize->add_section('metrika_settings', array('title' => __('Theme Style', 'metrika'), 'priority' => 10)); $wp_customize->add_section('metrika_email_info', array('title' => __('E-mail Details', 'metrika'), 'priority' => 130)); $wp_customize->add_section('metrika_contact_form', array('title' => __('Feedback', 'metrika'), 'priority' => 130)); $wp_customize->add_setting('metrika_theme_options[color]', array('default' => 'd06e39', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color', array('label' => __('Color', 'metrika'), 'section' => 'metrika_color', 'settings' => 'metrika_theme_options[color]'))); $wp_customize->add_setting('metrika_theme_options[menu_type]', array('default' => 'no', 'capability' => 'edit_theme_options', 'type' => 'option')); $wp_customize->add_control('metrika_menu_type', array('label' => __('', 'metrika'), 'section' => 'metrika_settings', 'settings' => 'metrika_theme_options[menu_type]', 'type' => 'radio', 'choices' => array('yes' => 'Metro', 'no' => 'Standart'))); }
function otherOptions() { $options = get_option('other_options'); $fonts = Metrika_google_fonts(); ?> <input type="hidden" id="favicon-id" value="<?php if (!empty($options['favicon'])) { echo $logo['logo_img']; } ?> "> <label class="pull-left"><?php _e('Upload Favicon:', 'metrika'); ?> <a href="#" id="favicon-upload" class="button-primary"><?php _e('Upload', 'metrika'); ?> </a> </label> <div class="favicon-preview pull-left"> <?php if (!empty($options['favicon'])) { ?> <?php echo wp_get_attachment_image($options['favicon'], 'full'); ?> <a href="#" id="remove-favicon"><i class="fa fa-trash-o"></i></a> <?php } ?> </div> <div class="clearfix"></div> <label style="vertical-align: top;"><?php _e('Link Color:', 'metrika'); ?> <input id="link_colorpicker" type="text" value="<?php echo !empty($options['link_color']) ? $options['link_color'] : '#ffffff'; ?> "> </label> <label><?php _e('Enable preloader:', 'metrika'); ?> <input type="checkbox" id="preloader_enable" <?php echo $options['preloader'] == 'true' ? 'checked' : ''; ?> > </label> <label style="vertical-align: top;"><?php _e('Preloader Color:', 'metrika'); ?> <input id="preloader_colorpicker" type="text" value="<?php echo !empty($options['preloader_color']) ? $options['preloader_color'] : '#0fa2cb'; ?> "> </label> <label id="font"><?php _e('Select Font:', 'metrika'); ?> <select> <?php foreach ($fonts as $key => $font) { ?> <option value="<?php echo $key; ?> " <?php if ($key == $options['font']) { echo 'selected="selected"'; } ?> ><?php echo $font['name']; ?> </option> <?php } ?> </select> </label> <div class="clearfix"></div> <a href="#" id="save-other" class="button-primary"><?php _e('Save Other', 'metrika'); ?> </a> <span class="other-save-status"></span> <?php }