/** * Field Render Function. */ function render($meta = false) { $class = isset($this->field['class']) ? 'class="' . $this->field['class'] . '" ' : ''; $name = !$meta ? $this->args['opt_name'] . '[' . $this->field['id'] . ']' : $this->field['id']; $fonts = mfn_fonts(); echo '<select name="' . $name . '" ' . $class . 'rows="6" >'; // system fonts echo '<optgroup label="' . __('System', 'mfn-opts') . '">'; foreach ($fonts['system'] as $font) { echo '<option value="' . $font . '"' . selected($this->value, $font, false) . '>' . $font . '</option>'; } echo '</optgroup>'; // custom font | uploaded in theme options if (key_exists('custom', $fonts)) { echo '<optgroup label="' . __('Custom (uploaded below)', 'mfn-opts') . '">'; foreach ($fonts['custom'] as $font) { echo '<option value="' . $font . '"' . selected($this->value, $font, false) . '>' . str_replace('#', '', $font) . '</option>'; } echo '</optgroup>'; } // google fonts | popular echo '<optgroup label="' . __('Popular Google Fonts', 'mfn-opts') . '">'; foreach ($fonts['popular'] as $font) { echo '<option value="' . $font . '"' . selected($this->value, $font, false) . '>' . $font . '</option>'; } echo '</optgroup>'; // google fonts | all echo '<optgroup label="' . __('Google Fonts', 'mfn-opts') . '">'; foreach ($fonts['all'] as $font) { echo '<option value="' . $font . '"' . selected($this->value, $font, false) . '>' . $font . '</option>'; } echo '</optgroup>'; echo '</select>'; echo isset($this->field['desc']) && !empty($this->field['desc']) ? ' <span class="description">' . $this->field['desc'] . '</span>' : ''; }
/** * Field Render Function. */ function render($meta = false) { $class = isset($this->field['class']) ? 'class="' . $this->field['class'] . '" ' : ''; $name = !$meta ? $this->args['opt_name'] . '[' . $this->field['id'] . ']' : $this->field['id']; $fonts = mfn_fonts(); echo '<select name="' . $name . '" ' . $class . 'rows="6" >'; echo '<optgroup label="' . __('Default', 'mfn-opts') . '">'; foreach ($fonts['default'] as $font) { echo '<option value="' . $font . '"' . selected($this->value, $font, false) . '>' . $font . '</option>'; } echo '</optgroup>'; echo '<optgroup label="' . __('System', 'mfn-opts') . '">'; foreach ($fonts['system'] as $font) { echo '<option value="' . $font . '"' . selected($this->value, $font, false) . '>' . $font . '</option>'; } echo '</optgroup>'; echo '<optgroup label="' . __('Popular Google Fonts', 'mfn-opts') . '">'; foreach ($fonts['popular'] as $font) { echo '<option value="' . $font . '"' . selected($this->value, $font, false) . '>' . $font . '</option>'; } echo '</optgroup>'; echo '<optgroup label="' . __('Google Fonts', 'mfn-opts') . '">'; foreach ($fonts['all'] as $font) { echo '<option value="' . $font . '"' . selected($this->value, $font, false) . '>' . $font . '</option>'; } echo '</optgroup>'; echo '</select>'; echo isset($this->field['desc']) && !empty($this->field['desc']) ? ' <span class="description">' . $this->field['desc'] . '</span>' : ''; }
function mfn_styles() { // wp_enqueue_style ------------------------------------------------------ echo '<link rel="stylesheet" href="' . THEME_URI . '/js/fancybox/jquery.fancybox-1.3.4.css?ver=' . THEME_VERSION . '" media="all" />' . "\n"; echo '<link rel="stylesheet" href="' . THEME_URI . '/css/responsiveslides.css?ver=' . THEME_VERSION . '" media="all" />' . "\n"; echo '<link rel="stylesheet" href="' . THEME_URI . '/css/jcarousel/skin.css?ver=' . THEME_VERSION . '" media="all" />' . "\n"; echo '<link rel="stylesheet" href="' . THEME_URI . '/css/ui/jquery.ui.all.css?ver=' . THEME_VERSION . '" media="all" />' . "\n"; // Custom Theme Options styles & responsive ------------------------------ if (mfn_opts_get('responsive')) { echo '<link rel="stylesheet" href="' . THEME_URI . '/css/responsive.css?ver=' . THEME_VERSION . '" media="all" />' . "\n"; } $skin = mfn_opts_get('skin', 'custom'); if ($skin == 'custom') { echo '<link rel="stylesheet" href="' . THEME_URI . '/css/skins/blue/images.css?ver=' . THEME_VERSION . '" media="all" />' . "\n"; echo '<link rel="stylesheet" href="' . THEME_URI . '/style-colors.php?ver=' . THEME_VERSION . '" media="all" />' . "\n"; } else { echo '<link rel="stylesheet" href="' . THEME_URI . '/css/skins/' . $skin . '/images.css?ver=' . THEME_VERSION . '" media="all" />' . "\n"; echo '<link rel="stylesheet" href="' . THEME_URI . '/css/skins/' . $skin . '/style.css?ver=' . THEME_VERSION . '" media="all" />' . "\n"; } echo '<link rel="stylesheet" href="' . THEME_URI . '/style.php?ver=' . THEME_VERSION . '" media="all" />' . "\n"; // Google Fonts ---------------------------------------------------------- $system_fonts = mfn_fonts('system'); $subset = mfn_opts_get('font-subset'); if ($subset) { $subset = '&subset=' . str_replace(' ', '', $subset); } $fonts['content'] = mfn_opts_get('font-content', 'Raleway'); $fonts['menu'] = mfn_opts_get('font-menu', 'Raleway'); $fonts['headings'] = mfn_opts_get('font-headings', 'Raleway'); foreach ($fonts as $font) { if (!in_array($font, $system_fonts)) { $font_slug = str_replace(' ', '+', $font); echo '<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=' . $font_slug . ':300,400,400italic,700' . $subset . '" >' . "\n"; } } echo '<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Patua+One" >' . "\n"; // Custom CSS ------------------------------------------------------------ if ($custom_css = mfn_opts_get('custom-css')) { echo '<style>' . "\n"; echo $custom_css . "\n"; echo '</style>' . "\n"; } }
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'); }
function mfn_styles() { // wp_enqueue_style ------------------------------------------------------ wp_enqueue_style('style', get_stylesheet_uri(), false, THEME_VERSION, 'all'); wp_enqueue_style('base', THEME_URI . '/css/base.css', false, THEME_VERSION, 'all'); wp_enqueue_style('btn', THEME_URI . '/css/buttons.css', false, THEME_VERSION, 'all'); wp_enqueue_style('icons', THEME_URI . '/fonts/mfn-icons.css', false, THEME_VERSION, 'all'); wp_enqueue_style('isotope', THEME_URI . '/css/isotope.css', false, THEME_VERSION, 'all'); wp_enqueue_style('grid', THEME_URI . '/css/grid.css', false, THEME_VERSION, 'all'); wp_enqueue_style('layout', THEME_URI . '/css/layout.css', false, THEME_VERSION, 'all'); wp_enqueue_style('shortcodes', THEME_URI . '/css/shortcodes.css', false, THEME_VERSION, 'all'); wp_enqueue_style('variables', THEME_URI . '/css/variables.css', false, THEME_VERSION, 'all'); // plugins wp_enqueue_style('animations', THEME_URI . '/js/animations/animations.min.css', false, THEME_VERSION, 'all'); wp_enqueue_style('colorpicker', THEME_URI . '/js/colorpicker/css/colorpicker.css', false, THEME_VERSION, 'all'); wp_enqueue_style('jquery-ui', THEME_URI . '/css/ui/jquery.ui.all.css', false, THEME_VERSION, 'all'); wp_enqueue_style('jplayer', THEME_URI . '/css/jplayer/jplayer.blue.monday.css', false, THEME_VERSION, 'all'); wp_enqueue_style('prettyPhoto', THEME_URI . '/css/prettyPhoto.css', false, THEME_VERSION, 'all'); // rtl | demo ----- if ($_GET && key_exists('mfn-rtl', $_GET)) { wp_enqueue_style('rtl', THEME_URI . '/rtl.css', false, THEME_VERSION, 'all'); } // Responsive ------------------------------------------------------------- if (mfn_is_960()) { wp_enqueue_style('responsive-960', THEME_URI . '/css/responsive-960.css', false, THEME_VERSION, 'all'); } else { wp_enqueue_style('responsive-1240', THEME_URI . '/css/responsive-1240.css', false, THEME_VERSION, 'all'); } if (mfn_opts_get('responsive')) { wp_enqueue_style('responsive', THEME_URI . '/css/responsive.css', false, THEME_VERSION, 'all'); } // Custom Theme Options styles -------------------------------------------- if (mfn_opts_get('static-css')) { // Static | style-static.css wp_enqueue_style('style-static', THEME_URI . '/style-static.css', false, THEME_VERSION, 'all'); } else { // Dynamic | style.php & ( style-colors.php || style-one.php || css/skins/.. ) if ($_GET && key_exists('mfn-c', $_GET)) { $skin = $_GET['mfn-c']; // demo } elseif ($layoutID = get_post_meta(mfn_ID(), 'mfn-post-custom-layout', true)) { $skin = get_post_meta($layoutID, 'mfn-post-skin', true); } else { $skin = mfn_opts_get('skin', 'custom'); } if ($skin == 'custom') { // Custom Skin wp_enqueue_style('style-colors-php', THEME_URI . '/style-colors.php', false, THEME_VERSION, 'all'); } elseif ($skin == 'one') { // One Click Skin Generator $color_one = $_GET && key_exists('mfn-o', $_GET) ? $_GET['mfn-o'] : THEME_VERSION; // demo wp_enqueue_style('style-one-php', THEME_URI . '/style-one.php', false, $color_one, 'all'); } else { // Predefined Skins wp_enqueue_style('skin-' . $skin, THEME_URI . '/css/skins/' . $skin . '/style.css', false, THEME_VERSION, 'all'); } wp_enqueue_style('style-php', THEME_URI . '/style.php', false, THEME_VERSION, 'all'); } // Google Fonts ---------------------------------------------------------- $google_fonts = mfn_fonts('all'); $subset = mfn_opts_get('font-subset'); if ($subset) { $subset = '&subset=' . str_replace(' ', '', $subset); } $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 . ':100,300,400,400italic,700' . $subset); } } // Google Font for counters etc. wp_enqueue_style('Patua+One', 'http' . mfn_ssl() . '://fonts.googleapis.com/css?family=Patua+One:400'); // Custom CSS wp_enqueue_style('custom', THEME_URI . '/css/custom.css', false, THEME_VERSION, 'all'); }