function mfn_styles()
 {
     $theme_disable = mfn_opts_get('theme-disable');
     // wp_enqueue_style ------------------------------------------------------
     wp_enqueue_style('style', get_stylesheet_uri(), false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-base', THEME_URI . '/css/base.css', false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-btn', THEME_URI . '/css/buttons.css', false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-icons', THEME_URI . '/fonts/mfn-icons.css', false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-grid', THEME_URI . '/css/grid.css', false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-layout', THEME_URI . '/css/layout.css', false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-shortcodes', THEME_URI . '/css/shortcodes.css', false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-variables', THEME_URI . '/css/variables.css', false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-style-simple', THEME_URI . '/css/style-simple.css', false, THEME_VERSION, 'all');
     // plugins
     if (!isset($theme_disable['entrance-animations'])) {
         wp_enqueue_style('mfn-animations', THEME_URI . '/assets/animations/animations.min.css', false, THEME_VERSION, 'all');
     }
     wp_enqueue_style('mfn-jquery-ui', THEME_URI . '/assets/ui/jquery.ui.all.css', false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-prettyPhoto', THEME_URI . '/assets/prettyPhoto/prettyPhoto.css', false, THEME_VERSION, 'all');
     wp_enqueue_style('mfn-jplayer', THEME_URI . '/assets/jplayer/css/jplayer.blue.monday.css', false, THEME_VERSION, 'all');
     // rtl | demo -----
     if ($_GET && key_exists('mfn-rtl', $_GET)) {
         wp_enqueue_style('mfn-rtl', THEME_URI . '/rtl.css', false, THEME_VERSION, 'all');
     }
     // Responsive -------------------------------------------------------------
     if (mfn_opts_get('responsive')) {
         if (mfn_is_960()) {
             wp_enqueue_style('mfn-responsive-960', THEME_URI . '/css/responsive-960.css', false, THEME_VERSION, 'all');
         } else {
             wp_enqueue_style('mfn-responsive-1240', THEME_URI . '/css/responsive-1240.css', false, THEME_VERSION, 'all');
         }
         wp_enqueue_style('mfn-responsive', THEME_URI . '/css/responsive.css', false, THEME_VERSION, 'all');
     } else {
         wp_enqueue_style('mfn-responsive-off', THEME_URI . '/css/responsive-off.css', false, THEME_VERSION, 'all');
     }
     // Custom Theme Options styles --------------------------------------------
     if (mfn_opts_get('static-css') && !($_GET && key_exists('mfn-c', $_GET))) {
         // Static | style-static.css
         if (defined('STATIC_IN_CHILD') && STATIC_IN_CHILD) {
             wp_enqueue_style('mfn-style-static', CHILD_THEME_URI . '/style-static.css', false, THEME_VERSION, 'all');
         } else {
             wp_enqueue_style('mfn-style-static', THEME_URI . '/style-static.css', false, THEME_VERSION, 'all');
         }
     } else {
         // Predefined Skins
         if ($_GET && key_exists('mfn-c', $_GET)) {
             $skin = $_GET['mfn-c'];
             // demo
         } elseif ($layoutID = mfn_layout_ID()) {
             $skin = get_post_meta($layoutID, 'mfn-post-skin', true);
         } else {
             $skin = mfn_opts_get('skin', 'custom');
         }
         if ($skin != 'custom' && $skin != 'one') {
             // Predefined Skins
             wp_enqueue_style('mfn-skin-' . $skin, THEME_URI . '/css/skins/' . $skin . '/style.css', false, THEME_VERSION, 'all');
         }
     }
     // Google Fonts ----------------------------------------------------------
     $google_fonts = mfn_fonts('all');
     // subset
     $subset = mfn_opts_get('font-subset');
     if ($subset) {
         $subset = '&subset=' . str_replace(' ', '', $subset);
     }
     // style & weight
     if ($weight = mfn_opts_get('font-weight')) {
         $weight = ':' . implode(',', $weight);
     }
     $fonts = mfn_fonts_selected();
     foreach ($fonts as $font) {
         if (in_array($font, $google_fonts)) {
             // Google Fonts
             $font_slug = str_replace(' ', '+', $font);
             wp_enqueue_style($font_slug, 'http' . mfn_ssl() . '://fonts.googleapis.com/css?family=' . $font_slug . $weight . $subset);
         }
     }
     // Google Font for counters etc.
     wp_enqueue_style('Patua+One', 'http' . mfn_ssl() . '://fonts.googleapis.com/css?family=Patua+One');
     // Custom CSS
     wp_enqueue_style('mfn-custom', THEME_URI . '/css/custom.css', false, THEME_VERSION, 'all');
 }
Example #2
0
function mfn_styles_custom_font()
{
    $fonts = mfn_fonts_selected();
    $font_custom = mfn_opts_get('font-custom');
    $font_custom2 = mfn_opts_get('font-custom2');
    if ($font_custom && in_array('#' . $font_custom, $fonts)) {
        echo '<style>' . "\n";
        echo '@font-face {';
        echo 'font-family: "' . $font_custom . '";';
        echo 'src: url("' . mfn_opts_get('font-custom-eot') . '");';
        echo 'src: url("' . mfn_opts_get('font-custom-eot') . '#iefix") format("embedded-opentype"),';
        echo 'url("' . mfn_opts_get('font-custom-woff') . '") format("woff"),';
        echo 'url("' . mfn_opts_get('font-custom-ttf') . '") format("truetype"),';
        echo 'url("' . mfn_opts_get('font-custom-svg') . '#' . $font_custom . '") format("svg");';
        echo 'font-weight: normal;';
        echo 'font-style: normal;';
        echo '}' . "\n";
        echo '</style>' . "\n";
    }
    if ($font_custom2 && in_array('#' . $font_custom2, $fonts)) {
        echo '<style>' . "\n";
        echo '@font-face {';
        echo 'font-family: "' . $font_custom2 . '";';
        echo 'src: url("' . mfn_opts_get('font-custom2-eot') . '");';
        echo 'src: url("' . mfn_opts_get('font-custom2-eot') . '#iefix") format("embedded-opentype"),';
        echo 'url("' . mfn_opts_get('font-custom2-woff') . '") format("woff"),';
        echo 'url("' . mfn_opts_get('font-custom2-ttf') . '") format("truetype"),';
        echo 'url("' . mfn_opts_get('font-custom2-svg') . '#' . $font_custom2 . '") format("svg");';
        echo 'font-weight: normal;';
        echo 'font-style: normal;';
        echo '}' . "\n";
        echo '</style>' . "\n";
    }
}