コード例 #1
0
 public function create_skin()
 {
     sup_generate_css($this->get_color_selectors(), 'color', 'sup_theme_skin', '#');
     sup_generate_css($this->get_background_selectors(), 'background', 'sup_theme_skin', '#');
     $palettes = self::get_palettes();
     $selected_palettes = get_theme_mod('sup_theme_skin');
     if ($selected_palettes && isset($palettes[$selected_palettes])) {
         $slide_bg = SUPERNOVA_IMG_URI . "/skins/slider-{$selected_palettes}.png";
         $menu_bg = SUPERNOVA_IMG_URI . "/skins/line-{$selected_palettes}.png";
         echo ".sup-slide-content{background-image : url({$slide_bg})}";
         echo ".sup-main-nav-row .row-container:after{background-image : url({$menu_bg})}";
     }
     //Font Family
     $sup_font_families = sup_font_families();
     $body_font_family = get_theme_mod('sup_body_font_family', 0);
     $body_font_family = isset($sup_font_families[$body_font_family]) ? $sup_font_families[$body_font_family] : false;
     echo "body{ font-family : {$body_font_family} }";
 }
コード例 #2
0
ファイル: nova-settings.php プロジェクト: sayedwp/supernova
|--------------------------------------------------------------------------
| Layout
|--------------------------------------------------------------------------
*/
Nova::add_section('layout', array('title' => esc_attr__('Layout', 'supernova'), 'priority' => 35, 'capability' => 'edit_theme_options'));
Nova::add_field('supernova', array('type' => 'radio-image', 'settings' => 'sup_sidebar_position', 'label' => '', 'description' => esc_attr__('Choose Sidebar Position.', 'supernova'), 'section' => 'layout', 'default' => 'right', 'choices' => array('left' => SUPERNOVA_IMG_URI . '/sidebar-left.png', 'right' => SUPERNOVA_IMG_URI . '/sidebar-right.png', 'no_sidebar' => SUPERNOVA_IMG_URI . '/no-sidebar.png')));
Nova::add_field('supernova', array('type' => 'slider', 'settings' => 'sup_layout_width', 'label' => esc_attr__('Layout Width', 'supernova'), 'description' => esc_attr__('Change the width of the website in pixel.', 'supernova'), 'section' => 'layout', 'default' => '1100', 'output' => array(array('element' => '.row, .row-container', 'property' => 'max-width', 'units' => 'px')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.row, .row-container', 'property' => 'max-width', 'units' => 'px', 'function' => 'css')), 'choices' => array('min' => 900, 'max' => 1400, 'step' => 1)));
Nova::add_field('supernova', array('type' => 'slider', 'settings' => 'sup_header_padding_top', 'label' => esc_attr__('Header Padding Top', 'supernova'), 'description' => esc_attr__('Change the header paddding in pixel.', 'supernova'), 'section' => 'layout', 'default' => '40', 'output' => array(array('element' => '.sup-site-header', 'property' => 'padding-top', 'units' => 'px')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.sup-site-header', 'property' => 'padding-top', 'units' => 'px', 'function' => 'css')), 'choices' => array('min' => 10, 'max' => 150, 'step' => 1)));
Nova::add_field('supernova', array('type' => 'slider', 'settings' => 'sup_header_padding_bottom', 'label' => esc_attr__('Header Padding Bottom', 'supernova'), 'description' => esc_attr__('Change the header paddding in pixel.', 'supernova'), 'section' => 'layout', 'default' => '40', 'output' => array(array('element' => '.sup-site-header', 'property' => 'padding-bottom', 'units' => 'px')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.sup-site-header', 'property' => 'padding-bottom', 'units' => 'px', 'function' => 'css')), 'choices' => array('min' => 10, 'max' => 150, 'step' => 1)));
/*
|--------------------------------------------------------------------------
| Typography
|--------------------------------------------------------------------------
*/
Nova::add_section('sup_typography_section', array('title' => esc_attr__('Typography', 'supernova'), 'priority' => 36, 'capability' => 'edit_theme_options'));
Nova::add_field('supernova', array('type' => 'select', 'settings' => 'sup_body_font_family', 'label' => esc_attr__('Body Font', 'supernova'), 'description' => esc_attr__('Would be applied to the content', 'supernova'), 'section' => 'sup_typography_section', 'default' => 0, 'choices' => sup_font_families()));
Nova::add_field('supernova', array('type' => 'slider', 'settings' => 'sup_font_size', 'label' => esc_attr__('Body Font Size', 'supernova'), 'description' => esc_attr__('Change the font size of the overall website.', 'supernova'), 'section' => 'sup_typography_section', 'default' => '16', 'output' => array(array('element' => 'html', 'property' => 'font-size', 'units' => 'px')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'html', 'property' => 'font-size', 'units' => 'px', 'function' => 'css')), 'choices' => array('min' => 10, 'max' => 20, 'step' => 1)));
/*
|--------------------------------------------------------------------------
| Slider Options
|--------------------------------------------------------------------------
*/
/*If you change this section name here also change it in js file */
Nova::add_section('slider_options_section', array('title' => esc_attr__('Slider Options', 'supernova'), 'priority' => 37, 'capability' => 'edit_theme_options'));
Nova::add_field('supernova', array('type' => 'repeater', 'label' => esc_attr__('Add Slides', 'supernova'), 'section' => 'slider_options_section', 'button_label' => __('Add New Slide', 'supernova'), 'description' => __('Slider may not look the same as you see in the preview.', 'supernova'), 'settings' => 'sup_slides', 'fields' => array('thumbnail_src' => array('type' => 'thumbnail_src', 'label' => esc_attr__('', 'supernova')), 'attachment_id' => array('type' => 'sup_uploader', 'label' => esc_attr__('', 'supernova')), 'post_id' => array('type' => 'select', 'label' => esc_attr__('Select Post (Optional)', 'supernova'), 'choices' => sup_posts_array()), 'title' => array('type' => 'text', 'label' => esc_attr__('Title', 'supernova')), 'excerpt' => array('type' => 'textarea', 'label' => esc_attr__('Excerpt', 'supernova')))));
/*
|--------------------------------------------------------------------------
| Display
|--------------------------------------------------------------------------
*/
Nova::add_panel('sup_display_panel', array('title' => __('Display', 'supernova'), 'priority' => 38, 'capability' => 'edit_theme_options'));