Exemplo n.º 1
0
function barcelona_ot_admin_styles_after()
{
    wp_register_style('google-font-montserrat', barcelona_get_protocol() . '//fonts.googleapis.com/css?family=Montserrat:400,700');
    wp_enqueue_style('google-font-montserrat');
    wp_register_style('barcelona-ot-admin', BARCELONA_THEME_PATH . 'includes/admin/css/barcelona-ot-admin.css', array(), BARCELONA_THEME_VERSION);
    wp_enqueue_style('barcelona-ot-admin');
    if (is_rtl()) {
        wp_register_style('barcelona-ot-admin-rtl', BARCELONA_THEME_PATH . 'includes/admin/css/barcelona-ot-admin-rtl.css', array(), BARCELONA_THEME_VERSION);
        wp_enqueue_style('barcelona-ot-admin-rtl');
    }
}
Exemplo n.º 2
0
function barcelona_get_font($extra_fonts = FALSE)
{
    $barcelona_options = barcelona_get_options(array('font_headings', 'font_general', 'font_latin_ext', 'font_cyrillic_ext', 'font_greek_charset'));
    $barcelona_font_names = array($barcelona_options['font_general'] . ':400,700,400italic');
    if ($barcelona_options['font_headings'] != $barcelona_options['font_general']) {
        $barcelona_font_names[] = $barcelona_options['font_headings'] . ':400,700';
    }
    if (is_array($extra_fonts)) {
        $barcelona_font_names = array_merge($barcelona_font_names, $extra_fonts);
    }
    $barcelona_font_subset = array('latin');
    if ($barcelona_options['font_cyrillic_ext'] == 'on') {
        $barcelona_font_subset[] = 'cyrillic,cyrillic-ext';
    }
    if ($barcelona_options['font_latin_ext'] == 'on') {
        $barcelona_font_subset[] = 'latin-ext';
    }
    if ($barcelona_options['font_greek_charset'] == 'on') {
        $barcelona_font_subset[] = 'greek,greek-ext';
    }
    $barcelona_font_href = barcelona_get_protocol() . '//fonts.googleapis.com/css?family=' . implode('|', $barcelona_font_names);
    if (count($barcelona_font_subset) > 1) {
        $barcelona_font_href .= '&subset=' . implode(',', $barcelona_font_subset);
    }
    $result = array(esc_url($barcelona_font_href));
    $barcelona_body_font_name = $barcelona_heading_font_name = strpos($barcelona_options['font_general'], "+") > 0 ? "'" . str_replace("+", " ", $barcelona_options['font_general']) . "'" : $barcelona_options['font_general'];
    if ($barcelona_options['font_headings'] != $barcelona_options['font_general']) {
        $barcelona_heading_font_name = strpos($barcelona_options['font_headings'], "+") > 0 ? "'" . str_replace("+", " ", $barcelona_options['font_headings']) . "'" : $barcelona_options['font_headings'];
    }
    $result[] = "<style type=\"text/css\">\nbody { font-family: " . esc_html($barcelona_body_font_name) . ", sans-serif; }\nh1,h2,h3,h4,h5,h6 { font-family: " . esc_html($barcelona_heading_font_name) . ", sans-serif; }\n</style>";
    return $result;
}