Exemple #1
0
function custom_style_inline_script()
{
    global $wd_data;
    $check_custom = get_option(THEME_SLUG . 'custom_check');
    if ($check_custom == 0) {
        return;
    }
    global $wd_font_name, $wd_font_size;
    //font
    if (file_exists(THEME_DIR . "/config_xml/font_config.xml")) {
        $objXML = simplexml_load_file(THEME_DIR . "/config_xml/font_config.xml");
        foreach ($objXML->children() as $child) {
            //items
            $name = $child->name;
            $slug = $child->slug;
            $type = $child->type;
            $std = $child->std;
            $selector = $child->selector;
            $font_name = esc_attr($wd_data["wd_" . $slug . "_googlefont"]);
            $font_name = str_replace(" ", "+", $font_name);
            if ($wd_data["wd_" . $slug . "_googlefont_enable"] == 0 && strcmp($font_name, 'none') != 0) {
                $wd_font_name = trim($font_name);
                //$wd_font_size = trim( $font_weight );
                wd_load_gg_fonts();
            }
        }
    }
    if (USING_CSS_CACHE == false) {
        global $custom_style;
        echo '<style type="text/css">';
        echo get_option(THEME_SLUG . 'custom_style', '');
        echo '</style>';
    }
}
function custom_style_inline_script()
{
    global $wd_data;
    $enable_style_fonts = absint($wd_data['wd_style_fonts']);
    $body_font = esc_attr($wd_data['wd_body_font1_googlefont']);
    $body_font = str_replace(" ", "+", $body_font);
    $heading_font = esc_attr($wd_data['wd_heading_font_googlefont']);
    $heading_font = str_replace(" ", "+", $heading_font);
    $horizontal_menu_font = esc_attr($wd_data['wd_menu_font_googlefont']);
    $horizontal_menu_font = str_replace(" ", "+", $horizontal_menu_font);
    $horizontal_submenu_font = esc_attr($wd_data['wd_submenu_font_googlefont']);
    $horizontal_submenu_font = str_replace(" ", "+", $horizontal_submenu_font);
    $vertical_menu_font = esc_attr($wd_data['wd_vertical_menu_googlefont']);
    $vertical_menu_font = str_replace(" ", "+", $vertical_menu_font);
    $vertical_submenu_font = esc_attr($wd_data['wd_vertical_submenu_googlefont']);
    $vertical_submenu_font = str_replace(" ", "+", $vertical_submenu_font);
    global $wd_font_name, $wd_font_size;
    if ($enable_style_fonts) {
        if ($wd_data['wd_body_font1_googlefont_enable'] == 0 && strcmp($body_font, 'none') != 0) {
            ?>
				<?php 
            $wd_font_name = trim($body_font);
            //$wd_font_size = trim( $body_font_weight );
            wd_load_gg_fonts();
            ?>
			<?php 
        }
        if ($wd_data['wd_heading_font_googlefont_enable'] == 0 && strcmp($heading_font, 'none') != 0) {
            ?>
				<?php 
            $wd_font_name = trim($heading_font);
            //$wd_font_size = trim( $heading_font_weight );
            wd_load_gg_fonts();
            ?>
			<?php 
        }
        if ($wd_data['wd_horizontal_menu_font_googlefont_enable'] == 0 && strcmp($horizontal_menu_font, 'none') != 0) {
            ?>
				<?php 
            $wd_font_name = trim($horizontal_menu_font);
            //$wd_font_size = trim( $horizontal_menu_font_weight );
            wd_load_gg_fonts();
            ?>
			<?php 
        }
        if ($wd_data['wd_horizontal_submenu_font_googlefont_enable'] == 0 && strcmp($horizontal_submenu_font, 'none') != 0) {
            ?>
				<?php 
            $wd_font_name = trim($horizontal_submenu_font);
            //$wd_font_size = trim( $horizontal_menu_font_weight );
            wd_load_gg_fonts();
            ?>
			<?php 
        }
        if ($wd_data['wd_vertical_menu_font_enable'] == 0 && strcmp($vertical_menu_font, 'none') != 0) {
            ?>
				<?php 
            $wd_font_name = trim($vertical_menu_font);
            //$wd_font_size = trim( $vertical_menu_font_weight );
            wd_load_gg_fonts();
            ?>
			<?php 
        }
        if ($wd_data['wd_vertical_submenu_font_enable'] == 0 && strcmp($vertical_submenu_font, 'none') != 0) {
            ?>
				<?php 
            $wd_font_name = trim($vertical_submenu_font);
            //$wd_font_size = trim( $vertical_menu_font_weight );
            wd_load_gg_fonts();
            ?>
			<?php 
        }
    }
    if (USING_CSS_CACHE == false) {
        global $custom_style;
        echo '<style type="text/css">';
        echo get_option(THEME_SLUG . 'custom_style', '');
        echo '</style>';
    }
}