/** * Adds the individual sections, settings, and controls to the theme customizer */ function lbmn_customizer($wp_customize) { /** * Get object of HeaderDesignPreset class with predesigned header settings * TODO: it's a bad practice to transmit object like this. * See: http://stackoverflow.com/a/889870 */ global $header_design_presets; $color_opacity_options = array('0' => '0%', '0.03' => '3%', '0.05' => '5%', '0.07' => '7%', '0.1' => '10%', '0.2' => '20%', '0.3' => '30%', '0.4' => '40%', '0.5' => '50%', '0.6' => '60%', '0.7' => '70%', '0.8' => '80%', '0.9' => '90%', '1' => '100%'); $bg_image_repeat_options = array('repeat' => 'Repeat', 'repeat-x' => 'Repeat Horizontal', 'repeat-y' => 'Repeat Vertical', 'no-repeat' => 'Do NOT Repeat'); $bg_image_position_options = array('left top' => 'Top Left', 'center top' => 'Top Center', 'right top' => 'Top Right', 'left center' => 'Center Left', 'center center' => 'Center', 'right center' => 'Center Right', 'left bottom' => 'Bottom Left', 'center bottom' => 'Bottom Center', 'right bottom' => 'Bottom Right'); $bg_image_attachment_options = array('scroll' => 'Scroll', 'fixed' => 'Fixed'); $bg_image_size_options = array('original' => 'Original', 'cover' => 'Cover', 'contain' => 'Contain'); /** * ---------------------------------------------------------------------- * Custom control types classes */ /** * Adds textarea support to the theme customizer */ class LBMN_Customize_Textarea_Control extends WP_Customize_Control { public $type = 'textarea'; public function render_content() { ?> <label> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <textarea rows="5" style="width:100%;" <?php $this->link(); ?> ><?php echo esc_textarea($this->value()); ?> </textarea> </label> <?php } } /** * Adds subheader control to the theme customizer */ class LBMN_Customize_Subheader_Control extends WP_Customize_Control { public $type = 'subheader'; public function render_content() { ?> <h3 class="customizer-subheader"><?php echo esc_html($this->label); ?> </h3> <?php } } /** * Adds custom color picker sliders support to the theme customizer */ class LBMN_Customize_Colorsliders_Control extends WP_Customize_Control { public $type = 'colorsliders'; public function render_content() { ?> <label> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> </label> <div class="color-picker-slider-wrap"> <input type="text" class="custom-color-picker-slider" <?php $this->link(); ?> value="<?php echo esc_attr($this->value()); ?> " data-color-format="rgb" /> </div> <?php } } /** * Adds slider support to the theme customizer * * http://ottopress.com/2012/making-a-custom-control-for-the-theme-customizer/comment-page-1/#comment-11705 * http://pastebin.com/NcHT6RRP */ class LBMN_Customize_Slider_Control extends WP_Customize_Control { // setup control type public $type = 'slider'; // function to enqueue the right jquery scripts and styles public function enqueue() { wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-slider'); } // override content render function to output slider HTML public function render_content() { ?> <label> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <input type="text" class="customizer-slider__text" id="input_<?php echo $this->id; ?> " value="<?php echo $this->value(); ?> " <?php $this->link(); ?> /> </label> <div id="slider_<?php echo $this->id; ?> " class="customizer-slider__slider"></div> <script> jQuery(document).ready(function($) { <?php // prepare value and max/min values $value = floatval(str_replace('px', '', $this->value())); $min = floatval(str_replace('px', '', $this->choices['min'])); $max = floatval(str_replace('px', '', $this->choices['max'])); ?> $( "#slider_<?php echo $this->id; ?> " ).slider({ value: <?php echo $value; ?> , min: <?php echo $min; ?> , max: <?php echo $max; ?> , step: <?php echo $this->choices['step']; ?> , slide: function( event, ui ) { $( "#input_<?php echo $this->id; ?> " ).val(ui.value).keyup(); } }); $( "#input_<?php echo $this->id; ?> " ).val( $( "#slider_<?php echo $this->id; ?> " ).slider( "value" ) ); }); </script> <?php } } /** * ---------------------------------------------------------------------- * Controls render functions */ /** * Render panel head * https://make.wordpress.org/core/2014/10/27/toward-a-complete-javascript-api-for-the-customizer/ */ function render_panel_header($label, $priority, $control_name, $description) { global $wp_customize; // if ( method_exists($wp_customize, 'add_panel' ) ) { // Requires WordPress 4.0. Check if `$wp_customize->add_panel()` method // exists for backwards compatibility. if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = 'customize-section-' . $control_name; } if (!isset($priority)) { $priority = 10; } $wp_customize->add_panel($control_name, array('priority' => $priority, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => $label, 'description' => $description)); } // } else { // Alternative for WP below 4.0 /* if ( isset( $label ) ) { $control_name = strtolower( $label ); $invalid_characters = array( "$", "%", "#", "<", ">", "|", " " ); $control_name = str_replace( $invalid_characters, '', $control_name ); $control_name = $section.'_'.$control_name; if ( !isset( $priority ) ) { $priority = 20; } $wp_customize->add_setting( $control_name ); $wp_customize->add_control( new LBMN_Customize_Subheader_Control ( $wp_customize, $control_name, array( 'type' => 'pseudo-section', 'label' => $label, 'section' => $section, 'priority'=> $priority, ) ) ); } */ // } } /** * Render section head */ function render_section_header($label, $priority, $control_name, $description, $panel = null) { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = 'customize-section-' . $control_name; } if (!isset($priority)) { $priority = 20; } $wp_customize->add_section($control_name, array('title' => $label, 'description' => $description, 'priority' => $priority, 'panel' => $panel)); } } /** * Render subheader control */ function render_subheader_control($label, $section, $priority) { global $wp_customize; if (isset($label)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; if (!isset($priority)) { $priority = 20; } $wp_customize->add_setting($control_name); $wp_customize->add_control(new LBMN_Customize_Subheader_Control($wp_customize, $control_name, array('type' => 'subheader', 'label' => $label, 'section' => $section, 'priority' => $priority))); } } /** * Render color picker control */ function render_colorpicker_control($label, $section, $priority, $default = null, $control_name = null) { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } if (!isset($default)) { $default = '#fff'; } $wp_customize->add_setting($control_name, array('default' => $default, 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $control_name, array('label' => $label, 'section' => $section, 'priority' => $priority))); } } /** * Render custom (JQuery Color Picker Sliders) color picker control */ function render_colorpickersliders_control($label, $section, $priority, $default = null, $control_name = null) { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } if (!isset($default)) { $default = '#fff'; } $wp_customize->add_setting($control_name, array('default' => $default, 'transport' => 'postMessage')); $wp_customize->add_control(new LBMN_Customize_Colorsliders_Control($wp_customize, $control_name, array('label' => $label, 'section' => $section, 'priority' => $priority))); } } /** * Render checkbox control */ function render_checkbox_control($label, $section, $priority, $default, $control_name) { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } if (!isset($default)) { $default = ''; } // if ( isset($control_type) ) { // for some reason control type doesn't work for checkbox // switch ( $control_type ) { // case 'option': // break; // case 'theme_mod': // break; // default: // $control_type = ''; // by default control type is 'theme_mod' // break; // } // } else { // $control_type = ''; // } $wp_customize->add_setting($control_name, array('default' => $default, 'sanitize_callback' => 'lbmn_sanitize_checkbox', 'transport' => 'postMessage')); $wp_customize->add_control($control_name, array('type' => 'checkbox', 'label' => $label, 'section' => $section, 'priority' => $priority)); } } /** * Render slider control */ function render_slider_control($label, $section, $priority, $default, $control_name = null, $control_type = null, $choises) { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } if (!isset($default)) { $default = ''; } if (isset($control_type)) { switch ($control_type) { case 'option': break; case 'theme_mod': break; default: $control_type = ''; // by default control type is 'theme_mod' break; } } else { $control_type = ''; } $wp_customize->add_setting($control_name, array('default' => $default, 'sanitize_callback' => 'lbmn_sanitize_text', 'transport' => 'postMessage')); $wp_customize->add_control(new LBMN_Customize_Slider_Control($wp_customize, $control_name, array('type' => 'text', 'label' => $label, 'section' => $section, 'priority' => $priority, 'choices' => $choises))); } } /** * Render text control */ function render_text_control($label, $section, $priority, $default, $control_name = null, $control_type = 'theme_mod') { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } if (!isset($default)) { $default = ''; } if ($control_type != 'option' && $control_type != 'theme_mod') { $control_type = 'theme_mod'; } $wp_customize->add_setting($control_name, array('default' => $default, 'sanitize_callback' => 'lbmn_sanitize_text', 'transport' => 'postMessage', 'type' => $control_type)); $wp_customize->add_control($control_name, array('type' => 'text', 'label' => $label, 'section' => $section, 'priority' => $priority)); } } /** * Render textarea control */ function render_textarea_control($label, $section, $priority, $default, $control_name = null, $control_type = null) { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } if (!isset($default)) { $default = ''; } if (isset($control_type)) { switch ($control_type) { case 'option': break; case 'theme_mod': break; default: $control_type = ''; // by default control type is 'theme_mod' break; } } else { $control_type = ''; } $wp_customize->add_setting($control_name, array('default' => $default, 'sanitize_callback' => 'lbmn_sanitize_text', 'transport' => 'postMessage')); $wp_customize->add_control(new LBMN_Customize_Textarea_Control($wp_customize, $control_name, array('type' => 'text', 'label' => $label, 'section' => $section, 'priority' => $priority))); } } /** * Render menu control */ function render_menu_control($label, $section, $priority, $control_name, $default_menu) { global $wp_customize; // Generation menu drop down choices $menus = wp_get_nav_menus(); $menuchoices = array(0 => __('— Select —', 'lbmn')); $default_menu_id = 0; foreach ($menus as $menu) { $menu_name = wp_html_excerpt($menu->name, 40, '…'); $menuchoices[$menu->term_id] = $menu_name; if ($default_menu == $menu_name) { // get menu id for default icons menu $default_menu_id = $menu->term_id; } } if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } $wp_customize->add_setting($control_name, array('sanitize_callback' => 'absint', 'theme_supports' => 'menus', 'default' => $default_menu_id)); $wp_customize->add_control($control_name, array('label' => $label, 'type' => 'select', 'choices' => $menuchoices, 'section' => $section, 'priority' => $priority)); } } /** * Render select control */ function render_select_control($label, $section, $priority, $control_name, $select_options, $default_select_option = '') { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } $wp_customize->add_setting($control_name, array('default' => $default_select_option)); $wp_customize->add_control($control_name, array('label' => $label, 'type' => 'select', 'section' => $section, 'priority' => $priority, 'choices' => $select_options)); } } function render_live_select_control($label, $section, $priority, $control_name, $select_options, $default_select_option = '') { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } $wp_customize->add_setting($control_name, array('default' => $default_select_option, 'transport' => 'postMessage')); $wp_customize->add_control($control_name, array('label' => $label, 'type' => 'select', 'section' => $section, 'priority' => $priority, 'choices' => $select_options)); } } /** * Render Google Fonts selector */ function render_googlefonts_control($label, $section, $priority, $control_name, $default_font) { global $wp_customize; $googlefonts = lbmn_get_goolefonts(); // $fontchoices = array( '— None —' => '— None —'); $fontchoices = array(); foreach ($googlefonts as $font => $font_ext) { // Prepare font name $fontname = str_replace('+', ' ', $font); // $fontname = str_replace(':', ': ', $fontname); // $fontname = str_replace('00', '00 ', $fontname); if (count($font_ext) && $font != $font_ext) { $fontname .= ': '; $first_custom_weight = true; foreach ($font_ext as $weight) { // if ( $weight == 'regular' ) { // $weight = '400'; // } $custom_font_style = $weight; if (!stristr($weight, 'italic')) { $custom_font_weight = preg_replace("/.*(\\d{3}).*/", "\$1", $weight); $custom_font_weight = intval($custom_font_weight); if ($custom_font_weight == 0) { $custom_font_weight = '400'; } if (!$first_custom_weight) { $fontname .= ', '; } $fontname .= $custom_font_weight; } else { // $fontname .= $weight . ' '; $fontname .= '+i'; } $first_custom_weight = false; } } $fontchoices[$font] = $fontname; } if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } $wp_customize->add_setting($control_name, array('default' => $default_font)); $wp_customize->add_control($control_name, array('label' => $label, 'type' => 'select', 'choices' => $fontchoices, 'section' => $section, 'priority' => $priority)); } } /** * Render image upload */ class MediaLibraryCallClosure { private $control_name; function __construct($control_name) { $this->control_name = $control_name; } function call() { ?> <a class="choose-from-library-link button" data-controller = "<?php esc_attr_e($this->control_name); ?> "> <?php _e('Open Library', 'lbmn'); ?> </a> <?php // return term_meta_cmp($a, $b, $this->meta); } } function render_image_control($label, $section, $priority, $control_name, $default_image = '') { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } $wp_customize->add_setting('lbmn_theme_options[' . $control_name . ']', array('default' => $default_image, 'capability' => 'edit_theme_options', 'type' => 'option')); $control = new WP_Customize_Image_Control($wp_customize, $control_name, array('label' => $label, 'section' => $section, 'priority' => $priority, 'settings' => 'lbmn_theme_options[' . $control_name . ']')); /* $control->add_tab( 'library', __( 'Media Library', 'lbmn' ), array(new MediaLibraryCallClosure($control_name), "call") ); */ $wp_customize->add_control($control); } } /** * Render file select */ function render_file_control($label, $section, $priority, $control_name, $default = '') { global $wp_customize; if (isset($label)) { if (!isset($control_name)) { $control_name = strtolower($label); $invalid_characters = array("\$", "%", "#", "<", ">", "|", " "); $control_name = str_replace($invalid_characters, '', $control_name); $control_name = $section . '_' . $control_name; } if (!isset($priority)) { $priority = 20; } $wp_customize->add_setting('lbmn_theme_options[' . $control_name . ']', array('default' => $default, 'capability' => 'edit_theme_options', 'type' => 'option')); $wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, $control_name, array('label' => $label, 'section' => $section, 'priority' => $priority, 'settings' => 'lbmn_theme_options[' . $control_name . ']'))); } } // Prepare font preset title function prepareFontPresetTitle($preset_no) { $font_preset_title = 'Font preset ' . $preset_no; if (get_theme_mod('lbmn_font_preset_usegooglefont_' . $preset_no, 1)) { // if Google Font activated if (get_theme_mod('lbmn_font_preset_googlefont_' . $preset_no, '')) { $font_preset_title .= ': ' . get_theme_mod('lbmn_font_preset_googlefont_' . $preset_no, ''); } else { $font_preset_title .= ': ' . get_theme_mod('lbmn_font_preset_googlefont_' . $preset_no, constant('LBMN_FONT_PRESET_GOOGLEFONT_' . $preset_no . '_DEFAULT')); } } elseif (get_theme_mod('lbmn_font_preset_webfont_' . $preset_no, '')) { $font_preset_title .= ': ' . get_theme_mod('lbmn_font_preset_webfont_' . $preset_no, ''); } else { $font_preset_title .= ': ' . get_theme_mod('lbmn_font_preset_standard_' . $preset_no, ''); } return $font_preset_title; } /** * ---------------------------------------------------------------------- * Predefined arrays */ $font_size_options = array('8px' => '8px', '9px' => '9px', '10px' => '10px', '11px' => '11px', '12px' => '12px', '13px' => '13px', '14px' => '14px', '15px' => '15px', '16px' => '16px', '18px' => '18px', '21px' => '21px', '24px' => '24px', '27px' => '27px', '32px' => '32px', '36px' => '36px', '48px' => '48px', '60px' => 'Oh man...'); $font_weight_options = array('100' => '100 Thin', '200' => '200 Light', '300' => '300 Book', '400' => '400 Regular', '500' => '500 Medium', '600' => '600 DemiBold', '700' => '700 Bold', '800' => '800 ExtraBold', '900' => '900 Heavy'); $font_styling_options = array('small' => __('Small', 'lbmn'), 'medium' => __('Medium', 'lbmn'), 'large' => __('Large', 'lbmn'), 'divider-1' => ' ', 'caps-small' => __('UPPERCASE: SMALL', 'lbmn'), 'caps-medium' => __('UPPERCASE: MEDIUM', 'lbmn'), 'caps-large' => __('UPPERCASE: LARGE', 'lbmn')); $panel_height_options = array('small' => __('Small', 'lbmn'), 'medium' => __('Medium', 'lbmn'), 'large' => __('Large', 'lbmn')); $font_preset_options = array('1' => prepareFontPresetTitle('1'), '2' => prepareFontPresetTitle('2'), '3' => prepareFontPresetTitle('3'), '4' => prepareFontPresetTitle('4')); $menu_align_options = array('left' => 'Left', 'center' => 'Center', 'right' => 'Right'); $menu_iconposition_options = array('left' => 'Left', 'top' => 'Above', 'right' => 'Right', 'disable_first_lvl' => 'Disable', 'disable_globally' => 'Disable Icons Globaly'); $menu_separator_options = array('none' => 'None', 'smooth' => 'Smooth', 'sharp' => 'Sharp'); $dropdown_animation_options = array('none' => 'None', 'anim_1' => 'Unfold', 'anim_2' => 'Fading', 'anim_3' => 'Scale', 'anim_4' => 'Down to Up', 'anim_5' => 'Dropdown'); $logo_placement_options = array('top-left' => 'Top-Left', 'top-center' => 'Top-Center', 'top-right' => 'Top-Right', 'divider-1' => ' ', 'bottom-left' => 'Botttom-Left', 'bottom-right' => 'Botttom-Right'); /** * ---------------------------------------------------------------------- * Notification panel section */ render_panel_header('Notification panel', 40, 'lbmn_panel_notificationpanel', 'Site-wide notification panel settings'); render_section_header('Basic Settings', 40, 'lbmn_notificationpanel_basic', '', 'lbmn_panel_notificationpanel'); render_checkbox_control('Enable', 'lbmn_notificationpanel_basic', 20, 1, 'lbmn_notificationpanel_switch'); // Notification panel switch render_slider_control('Height', 'lbmn_notificationpanel_basic', 22, LBMN_NOTIFICATIONPANEL_HEIGHT_DEFAULT, 'lbmn_notificationpanel_height', null, array('min' => '40', 'max' => '120', 'step' => '2')); // Notification panel main controls render_section_header('Message Elements', 50, 'lbmn_notificationpanel_elements', '', 'lbmn_panel_notificationpanel'); // render_text_control ( 'Icon', 'lbmn_notificationpanel', 25, LBMN_NOTIFICATIONPANEL_DEFAULT ); // Notification panel icon render_textarea_control('Message', 'lbmn_notificationpanel_elements', 30, LBMN_NOTIFICATIONPANEL_MESSAGE_DEFAULT, 'lbmn_notificationpanel_message'); // Notification message render_text_control('Linked URL', 'lbmn_notificationpanel_elements', 40, LBMN_NOTIFICATIONPANEL_BUTTONURL_DEFAULT, 'lbmn_notificationpanel_buttonurl'); // Call to action button url // Colors render_section_header('Colors', 60, 'lbmn_notificationpanel_colors', '', 'lbmn_panel_notificationpanel'); render_colorpickersliders_control('Background Color', 'lbmn_notificationpanel_colors', 200, LBMN_NOTIFICATIONPANEL_BACKGROUNDCOLOR_DEFAULT, 'lbmn_notificationpanel_backgroundcolor'); // Top panel bg color render_colorpickersliders_control('Text Color', 'lbmn_notificationpanel_colors', 300, LBMN_NOTIFICATIONPANEL_TXTCOLOR_DEFAULT, 'lbmn_notificationpanel_textcolor'); // Top panel text color render_colorpickersliders_control('Background Hover Color', 'lbmn_notificationpanel_colors', 320, LBMN_NOTIFICATIONPANEL_BACKGROUNDCOLOR_HOVER_DEFAULT, 'lbmn_notificationpanel_backgroundcolor_hover'); render_colorpickersliders_control('Text Hover Color', 'lbmn_notificationpanel_colors', 340, LBMN_NOTIFICATIONPANEL_TXTCOLOR_HOVER_DEFAULT, 'lbmn_notificationpanel_textcolor_hover'); /** * ---------------------------------------------------------------------- * Top panel section */ render_panel_header('Top bar', 50, 'lbmn_panel_topbar', 'Site-wide top panel settings'); render_section_header('Basic Settings', 10, 'lbmn_topbar_basic', '', 'lbmn_panel_topbar'); render_checkbox_control('Enable', 'lbmn_topbar_basic', 20, 1, 'lbmn_topbar_switch'); // Top panel switch render_slider_control('Height', 'lbmn_topbar_basic', 25, LBMN_TOPBAR_HEIGHT_DEFAULT, 'lbmn_topbar_height', null, array('min' => '30', 'max' => '80', 'step' => '2')); render_section_header('Colors', 20, 'lbmn_topbar_colors', '', 'lbmn_panel_topbar'); render_colorpickersliders_control('Background Color', 'lbmn_topbar_colors', 100, LBMN_TOPBAR_BACKGROUNDCOLOR_DEFAULT, 'lbmn_topbar_backgroundcolor'); render_colorpickersliders_control('Link Color', 'lbmn_topbar_colors', 110, LBMN_TOPBAR_LINKCOLOR_DEFAULT, 'lbmn_topbar_linkcolor'); render_colorpickersliders_control('Link Hover Color', 'lbmn_topbar_colors', 120, LBMN_TOPBAR_LINKHOVERCOLOR_DEFAULT, 'lbmn_topbar_linkhovercolor'); render_colorpickersliders_control('Link Hover Background Color', 'lbmn_topbar_colors', 130, LBMN_TOPBAR_LINKHOVERBGCOLOR_DEFAULT, 'lbmn_topbar_linkhoverbackgroundcolor'); render_colorpickersliders_control('Text Lines Color', 'lbmn_topbar_colors', 140, LBMN_TOPBAR_TEXTCOLOR_DEFAULT, 'lbmn_topbar_textlinescolor'); render_section_header('Font', 30, 'lbmn_topbar_font', '', 'lbmn_panel_topbar'); render_live_select_control('Font Family', 'lbmn_topbar_font', 310, 'lbmn_topbar_firstlevelitems_font', $font_preset_options, LBMN_TOPBAR_FIRSTLEVELITEMS_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_topbar_font', 330, 'lbmn_topbar_firstlevelitems_fontweight', $font_weight_options, LBMN_TOPBAR_FIRSTLEVELITEMS_FONTWEIGHT_DEFAULT); //$font_weight_options // get_theme_mod( 'lbmn_headertop_firstlevelitems_font') render_slider_control('Font Size (px)', 'lbmn_topba_fontr', 340, LBMN_TOPBAR_FIRSTLEVELITEMS_FONTSIZE_DEFAULT, 'lbmn_topbar_firstlevelitems_fontsize', null, array('min' => '10', 'max' => '80', 'step' => '1')); render_section_header('Settings', 40, 'lbmn_topbar_settings', '', 'lbmn_panel_topbar'); render_live_select_control('First Level Items Align', 'lbmn_topbar_settings', 410, 'lbmn_topbar_firstlevelitems_align', $menu_align_options, LBMN_TOPBAR_FIRSTLEVELITEMS_ALIGN_DEFAULT); render_live_select_control('Icon Position', 'lbmn_topbar_settings', 420, 'lbmn_topbar_firstlevelitems_iconposition', $menu_iconposition_options, LBMN_TOPBAR_FIRSTLEVELITEMS_ICONPOSITION_DEFAULT); render_slider_control('Icon Size (px)', 'lbmn_topbar_settings', 430, LBMN_TOPBAR_FIRSTLEVELITEMS_ICONSIZE_DEFAULT, 'lbmn_topbar_firstlevelitems_iconsize', null, array('min' => '5', 'max' => '30', 'step' => '1')); render_live_select_control('Items Separator', 'lbmn_topbar_settings', 440, 'lbmn_topbar_firstlevelitems_separator', $menu_separator_options, LBMN_TOPBAR_FIRSTLEVELITEMS_SEPARATOR_DEFAULT); render_slider_control('Items Separator Opacity', 'lbmn_topbar_settings', 450, LBMN_TOPBAR_FIRSTLEVELITEMS_SEPARATOR_OPACITY_DEFAULT, 'lbmn_topbar_firstlevelitems_separator_opacity', null, array('min' => '0', 'max' => '1', 'step' => '0.01')); /** * ---------------------------------------------------------------------- * Header top section */ render_panel_header('Header design', 63, 'lbmn_panel_headertop', 'Site-wide header settings'); render_section_header('Basic Settings', 10, 'lbmn_headertop_basic', '', 'lbmn_panel_headertop'); // $header_design_preset_options = $header_design_presets->get_header_preset_list(); // render_select_control ( 'Header design', 'lbmn_headertop', 10, 'lbmn_header_design', $header_design_preset_options, LBMN_HEADER_DESIGN_DEFAULT ); render_colorpickersliders_control('Background Color', 'lbmn_headertop_basic', 185, LBMN_HEADERTOP_BACKGROUNDCOLOR_DEFAULT, 'lbmn_headertop_backgroundcolor'); render_slider_control('Header Height', 'lbmn_headertop_basic', 210, LBMN_HEADERTOP_HEIGHT_DEFAULT, 'lbmn_headertop_height', null, array('min' => '30', 'max' => '200', 'step' => '2')); render_slider_control('Menu Height', 'lbmn_headertop_basic', 215, LBMN_HEADERTOP_MENUHEIGHT_DEFAULT, 'lbmn_headertop_menu_height', null, array('min' => '30', 'max' => '100', 'step' => '2')); render_section_header('Sticky On Scroll', 10, 'lbmn_sticky-settings', '', 'lbmn_panel_headertop'); render_checkbox_control('Stick the menu on scroll', 'lbmn_sticky-settings', 220, LBMN_HEADERTOP_STICK_SWITCH_DEFAULT, 'lbmn_headertop_stick'); render_colorpickersliders_control('Background Color', 'lbmn_sticky-settings', 225, LBMN_HEADERTOP_STICK_BACKGROUNDCOLOR_DEFAULT, 'lbmn_headertop_stick_backgroundcolor'); render_slider_control('Sticky/Mobile Menu Height', 'lbmn_sticky-settings', 230, LBMN_HEADERTOP_STICK_DEFAULT, 'lbmn_headertop_stick_height', null, array('min' => '30', 'max' => '100', 'step' => '2')); render_slider_control('Sticky/Mobile Menu Padding', 'lbmn_sticky-settings', 234, LBMN_HEADERTOP_STICKY_PADDING_DEFAULT, 'lbmn_headertop_sticky_padding', null, array('min' => '0', 'max' => '60', 'step' => '2')); render_slider_control('Sticky Scroll Offset (save to apply)', 'lbmn_sticky-settings', 240, LBMN_HEADERTOP_STICKYOFFSET_DEFAULT, 'lbmn_headertop_stickyoffset', null, array('min' => '0', 'max' => '400', 'step' => '2')); /** * ---------------------------------------------------------------------- * Website Logo section */ render_panel_header('Logo', 65, 'lbmn_panel_logo', 'Website logotype settings'); render_section_header('Basic Settings', 10, 'lbmn_logo_basic', '', 'lbmn_panel_logo'); render_live_select_control('Placement:', 'lbmn_logo_basic', 20, 'lbmn_logo_placement', $logo_placement_options, LBMN_LOGO_PLACEMENT_DEFAULT); render_image_control('Normal Image', 'lbmn_logo_basic', 30, 'lbmn_logo_image', LBMN_LOGO_IMAGE_DEFAULT); //$default_image - optional parameter render_slider_control('Maximum Logo Height (% to the height of the top header)', 'lbmn_logo_basic', 40, LBMN_LOGO_IMAGE_HEIGHT_DEFAULT, 'lbmn_logo_height', null, array('min' => '10', 'max' => '100', 'step' => '1')); render_section_header('More Settings', 10, 'lbmn_logo_settings', '', 'lbmn_panel_logo'); render_slider_control('Margin top (optional)', 'lbmn_logo_settings', 60, '', 'lbmn_logo_margin_top', null, array('min' => '-100', 'max' => '100', 'step' => '2')); render_slider_control('Margin left (optional)', 'lbmn_logo_settings', 65, '', 'lbmn_logo_margin_left', null, array('min' => '-100', 'max' => '100', 'step' => '2')); render_slider_control('Margin right (optional)', 'lbmn_logo_settings', 70, '', 'lbmn_logo_margin_right', null, array('min' => '-100', 'max' => '100', 'step' => '2')); /** * ---------------------------------------------------------------------- * Mega Menu Settings */ render_panel_header('Mega Menu', 75, 'lbmn_panel_megamenu', 'Site-wide header settings'); render_section_header('Colors', 10, 'lbmn_megamenu_colors', '', 'lbmn_panel_megamenu'); render_colorpickersliders_control('Link Color', 'lbmn_megamenu_colors', 110, LBMN_HEADERTOP_LINKCOLOR_DEFAULT, 'lbmn_megamenu_linkcolor'); render_colorpickersliders_control('Link Hover Color', 'lbmn_megamenu_colors', 120, LBMN_HEADERTOP_LINKHOVERCOLOR_DEFAULT, 'lbmn_megamenu_linkhovercolor'); render_colorpickersliders_control('Link Hover Background Color', 'lbmn_megamenu_colors', 130, LBMN_MEGAMENU_LINKHOVERBACKGROUNDCOLOR_DEFAULT, 'lbmn_megamenu_linkhoverbackgroundcolor'); render_colorpickersliders_control('Text Lines Color', 'lbmn_megamenu_colors', 140, LBMN_HEADERTOP_TEXTCOLOR_DEFAULT, 'lbmn_megamenu_textlinescolor'); render_section_header('Font', 30, 'lbmn_megamenu_font', '', 'lbmn_panel_megamenu'); render_live_select_control('Font Family', 'lbmn_megamenu_font', 310, 'lbmn_megamenu_firstlevelitems_font', $font_preset_options, LBMN_MEGAMENU_FIRSTLEVELITEMS_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_megamenu_font', 320, 'lbmn_megamenu_firstlevelitems_fontweight', $font_weight_options, LBMN_MEGAMENU_FIRSTLEVELITEMS_FONTWEIGHT_DEFAULT); //$font_weight_options // get_theme_mod( 'lbmn_headertop_firstlevelitems_font') render_slider_control('Font Size (px)', 'lbmn_megamenu_font', 330, LBMN_MEGAMENU_FIRSTLEVELITEMS_FONTSIZE_DEFAULT, 'lbmn_megamenu_firstlevelitems_fontsize', null, array('min' => '10', 'max' => '36', 'step' => '1')); render_section_header('More Settings', 40, 'lbmn_megamenu_settings', '', 'lbmn_panel_megamenu'); render_live_select_control('First Level Items Align', 'lbmn_megamenu_settings', 410, 'lbmn_megamenu_firstlevelitems_align', $menu_align_options, LBMN_MEGAMENU_FIRSTLEVELITEMS_ALIGN_DEFAULT); render_slider_control('Hover/Active Border Radius', 'lbmn_megamenu_settings', 420, LBMN_HEADERTOP_LINKHOVERBORDERRADIUS_DEFAULT, 'lbmn_megamenu_linkhoverborderradius', null, array('min' => '0', 'max' => '30', 'step' => '1')); render_slider_control('First Level Items Outer Spacing', 'lbmn_megamenu_settings', 430, LBMN_MEGAMENU_FIRSTLEVELITEMS_SPACING_DEFAULT, 'lbmn_megamenu_firstlevelitems_spacing', null, array('min' => '0', 'max' => '20', 'step' => '1')); render_slider_control('First Level Items Inner Spacing', 'lbmn_megamenu_settings', 440, LBMN_MEGAMENU_FIRSTLEVELITEMS_INNERSPACING_DEFAULT, 'lbmn_megamenu_firstlevelitems_innerspacing', null, array('min' => '0', 'max' => '20', 'step' => '1')); render_subheader_control('Icons', 'lbmn_megamenu_settings', 445); render_live_select_control('Icon Position', 'lbmn_megamenu_settings', 450, 'lbmn_megamenu_firstlevelitems_iconposition', $menu_iconposition_options, LBMN_MEGAMENU_FIRSTLEVELITEMS_ICONPOSITION_DEFAULT); render_slider_control('Icon Size (px)', 'lbmn_megamenu_settings', 460, LBMN_MEGAMENU_FIRSTLEVELITEMS_ICONSIZE_DEFAULT, 'lbmn_megamenu_firstlevelitems_iconsize', null, array('min' => '5', 'max' => '30', 'step' => '1')); render_subheader_control('Separators', 'lbmn_megamenu_settings', 465); render_live_select_control('Items Separator', 'lbmn_megamenu_settings', 470, 'lbmn_megamenu_firstlevelitems_separator', $menu_separator_options, LBMN_MEGAMENU_FIRSTLEVELITEMS_SEPARATOR_DEFAULT); render_slider_control('Items Separator Opacity', 'lbmn_megamenu_settings', 480, LBMN_MEGAMENU_FIRSTLEVELITEMS_SEPARATOR_OPACITY_DEFAULT, 'lbmn_megamenu_firstlevelitems_separator_opacity', null, array('min' => '0', 'max' => '1', 'step' => '.05')); render_slider_control('Items Separator Opacity', 'lbmn_megamenu_settings', 490, LBMN_TOPBAR_FIRSTLEVELITEMS_SEPARATOR_OPACITY_DEFAULT, 'lbmn_topbar_firstlevelitems_separator_opacity', null, array('min' => '0', 'max' => '1', 'step' => '0.01')); render_subheader_control('Menu elements', 'lbmn_megamenu_settings', 500); render_checkbox_control('Enable WPML switcher', 'lbmn_megamenu_settings', 510, 0, 'lbmn_megamenu_wpml_switcher'); render_text_control('Label For Mobile Menu', 'lbmn_megamenu_settings', 520, 'Menu', 'lbmn_megamenu_mobile_label'); /** * ---------------------------------------------------------------------- * Mega Menu – Dropdown Settings */ render_section_header('Mega Menu: Dropdown', 80, 'lbmn_megamenu_dropdown', 'Site-wide header settings', 'lbmn_panel_megamenu'); render_subheader_control('Colors', 'lbmn_megamenu_dropdown', 100); render_colorpickersliders_control('Text Color', 'lbmn_megamenu_dropdown', 140, LBMN_MEGAMENU_DROPDOWN_TEXTCOLOR_DEFAULT, 'lbmn_megamenu_dropdown_textcolor'); render_colorpickersliders_control('Link Color', 'lbmn_megamenu_dropdown', 155, LBMN_MEGAMENU_DROPDOWN_LINKCOLOR_DEFAULT, 'lbmn_megamenu_dropdown_linkcolor'); render_colorpickersliders_control('Link Hover Color', 'lbmn_megamenu_dropdown', 160, LBMN_MEGAMENU_DROPDOWN_LINKHOVERCOLOR_DEFAULT, 'lbmn_megamenu_dropdown_linkhovercolor'); render_colorpickersliders_control('Link Hover Background Color', 'lbmn_megamenu_dropdown', 165, LBMN_MEGAMENU_DROPDOWN_LINKHOVERBACKGROUNDCOLOR_DEFAULT, 'lbmn_megamenu_dropdown_linkhoverbackgroundcolor'); render_colorpickersliders_control('Dropdown Background Color', 'lbmn_megamenu_dropdown', 170, LBMN_MEGAMENU_DROPDOWN_BACKGROUND_DEFAULT, 'lbmn_megamenu_dropdown_background'); render_colorpickersliders_control('Menu Items Divider Color', 'lbmn_megamenu_dropdown', 175, LBMN_MEGAMENU_DROPDOWN_MENUITEMSDIVIDERCOLOR_DEFAULT, 'lbmn_megamenu_dropdown_menuitemsdividercolor'); render_subheader_control('Fonts', 'lbmn_megamenu_dropdown', 300); render_live_select_control('Font Family', 'lbmn_megamenu_dropdown', 360, 'lbmn_megamenu_dropdown_font', $font_preset_options, LBMN_MEGAMENU_DROPDOWN_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_megamenu_dropdown', 370, 'lbmn_megamenu_dropdown_fontweight', $font_weight_options, LBMN_MEGAMENU_DROPDOWN_FONTWEIGHT_DEFAULT); render_slider_control('Font Size (px)', 'lbmn_megamenu_dropdown', 380, LBMN_MEGAMENU_DROPDOWN_FONTSIZE_DEFAULT, 'lbmn_megamenu_dropdown_fontsize', null, array('min' => '10', 'max' => '30', 'step' => '1')); render_slider_control('Icon Size (px)', 'lbmn_megamenu_dropdown', 390, LBMN_MEGAMENU_DROPDOWN_ICONSIZE_DEFAULT, 'lbmn_megamenu_dropdown_iconsize', null, array('min' => '10', 'max' => '30', 'step' => '1')); render_subheader_control('Menu settings', 'lbmn_megamenu_dropdown', 400); render_live_select_control('Dropdowns Animation', 'lbmn_megamenu_dropdown', 415, 'lbmn_megamenu_dropdown_animation', $dropdown_animation_options, LBMN_MEGAMENU_DROPDOWN_ANIMATION_DEFAULT); render_slider_control('Dropdown Panel Radius', 'lbmn_megamenu_dropdown', 420, LBMN_MEGAMENU_DROPDOWNRADIUS_DEFAULT, 'lbmn_megamenu_dropdownradius', null, array('min' => '0', 'max' => '20', 'step' => '1')); render_slider_control('Dropdown Marker Opacity', 'lbmn_megamenu_dropdown', 430, LBMN_MEGAMENU_DROPDOWN_MARKEROPACITY_DEFAULT, 'lbmn_megamenu_dropdown_markeropacity', null, array('min' => '0', 'max' => '1', 'step' => '.01')); /** * ---------------------------------------------------------------------- * Search Block */ $searchblock_placement_options = array('topbar-default' => __('Top panel:', 'lbmn'), 'topbar-left' => __('— Left', 'lbmn'), 'topbar-right' => __('— Right', 'lbmn'), 'divider-1' => ' ', 'headertop-default' => __('Header top:', 'lbmn'), 'headertop-left' => __('— Left', 'lbmn'), 'headertop-right' => __('— Right', 'lbmn'), 'divider-2' => ' ', 'headerbottom-default' => __('Header bottom:', 'lbmn'), 'headerbottom-left' => __('— Left', 'lbmn'), 'headerbottom-right' => __('— Right', 'lbmn')); $searchblock_shadow_options = array('inside' => 'Inner shadow', 'outside' => 'Outer shadow', 'none' => 'None'); render_section_header('Search field', 90, 'lbmn_searchblock', 'Settings for the search block in the site header'); render_checkbox_control('Enable', 'lbmn_searchblock', 20, 1, 'lbmn_searchblock_switch'); // Top panel switch render_slider_control('Input Field Width (px)', 'lbmn_searchblock', 110, LBMN_SEARCHBLOCK_INPUTFIELDWIDTH_DEFAULT, 'lbmn_searchblock_inputfieldwidth', null, array('min' => '100', 'max' => '300', 'step' => '2')); render_slider_control('Input Field Radius (px)', 'lbmn_searchblock', 115, LBMN_SEARCHBLOCK_INPUTFIELDRADIUS_DEFAULT, 'lbmn_searchblock_inputfieldradius', null, array('min' => '0', 'max' => '100', 'step' => '1')); render_live_select_control('Input Field Shadow', 'lbmn_searchblock', 120, 'lbmn_searchblock_shadow', $searchblock_shadow_options, LBMN_SEARCHBLOCK_SHADOW_DEFAULT); render_colorpickersliders_control('Input Background Color', 'lbmn_searchblock', 200, LBMN_SEARCHBLOCK_INPUTBACKGROUNDCOLOR_DEFAULT); render_colorpickersliders_control('Text and Icon Color', 'lbmn_searchblock', 210, LBMN_SEARCHBLOCK_TEXTANDICONCOLOR_DEFAULT, 'lbmn_searchblock_textandiconcolor'); /** * ---------------------------------------------------------------------- * Sidebar settings (not needed since using Live Composer) */ /* $active_customposttypes_options = array( "none" => "No sidebar (full width)", "right" => "Sidebar on the right", "left" => "Sidebar on the left", ); render_section_header ( 'Sidebar', 200, 'lbmn_sidebar', 'Here you can set default sidebar position for the post types available.' ); $post_types = get_post_types( '', 'objects' ); // output all the custom post types // remove some standard WordPress post types we are not interested in unset ( $post_types['revision'] ); unset ( $post_types['nav_menu_item'] ); unset ( $post_types['attachment'] ); // remove standard WooCommerce post types unset ( $post_types['product'] ); unset ( $post_types['shop_coupon'] ); unset ( $post_types['shop_order'] ); unset ( $post_types['product_variation'] ); // remove WooSidebars content type unset ( $post_types['sidebar'] ); // remove our "Section Slider" post type unset ( $post_types['section_slider'] ); foreach ( $post_types as $post_type ) { // only blog posts has sidebar right enabled by default if ( $post_type->name == 'post' ) { render_select_control ( $post_type->label, 'lbmn_sidebar', 20, 'lbmn_sidebar_list'.$post_type->name, $active_customposttypes_options, 'right' ); } else { render_select_control ( $post_type->label, 'lbmn_sidebar', 20, 'lbmn_sidebar_list'.$post_type->name, $active_customposttypes_options, 'none' ); } } */ // ------------------------------------------------------------------------- // Page Layout Section // ------------------------------------------------------------------------- render_section_header('Page Layout and Background', 240, 'page_layout', 'Here you can customize colors.'); render_colorpickersliders_control('Content Background Color', 'page_layout', 10, LBMN_CONTENT_BACKGROUND_COLOR_DEFAULT, 'lbmn_content_background_color'); render_checkbox_control('Make Page Layout Boxed ', 'page_layout', 15, LBMN_PAGELAYOUTBOXED_SWITCH_DEFAULT, 'lbmn_pagelayoutboxed_switch'); // Botttom panel switch render_colorpickersliders_control('Background Color', 'page_layout', 20, LBMN_PAGEBACKGROUNDCOLOR_DEFAULT, 'lbmn_page_background_color'); render_image_control('Background Image', 'page_layout', 30, 'lbmn_page_background_image'); //$default_image - optional parameter render_slider_control('Background Image Opacity', 'page_layout', 40, '1', 'lbmn_page_background_image_opacity', null, array('min' => '0', 'max' => '1', 'step' => '.01')); render_live_select_control('Background Image Repeat', 'page_layout', 50, 'lbmn_page_background_image_repeat', $bg_image_repeat_options, 'repeat'); render_live_select_control('Background Image Position', 'page_layout', 60, 'lbmn_page_background_image_position', $bg_image_position_options, 'center top'); render_live_select_control('Background Image Attachment', 'page_layout', 70, 'lbmn_page_background_image_attachment', $bg_image_attachment_options, 'scroll'); render_live_select_control('Background Image Size', 'page_layout', 80, 'lbmn_page_background_image_size', $bg_image_size_options, 'original'); /** * ---------------------------------------------------------------------- * Typography section */ render_section_header('Typography and Text Colors', 250, 'lbmn_typography', 'All the setings to make your text looks awesome.'); render_colorpickersliders_control('Link Color', 'lbmn_typography', 10, LBMN_TYPOGRAPHY_LINK_COLOR_DEFAULT, 'lbmn_typography_link_color'); render_colorpickersliders_control('Link Hover Color', 'lbmn_typography', 20, LBMN_TYPOGRAPHY_LINK_HOVER_COLOR_DEFAULT, 'lbmn_typography_link_hover_color'); render_subheader_control('Paragraphs', 'lbmn_typography', 100); render_live_select_control('Font Family', 'lbmn_typography', 110, 'lbmn_typography_p_font', $font_preset_options, LBMN_TYPOGRAPHY_P_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_typography', 130, 'lbmn_typography_p_fontweight', $font_weight_options, LBMN_TYPOGRAPHY_P_FONTWEIGHT_DEFAULT); render_slider_control('Font Size (px)', 'lbmn_typography', 140, LBMN_TYPOGRAPHY_P_FONTSIZE_DEFAULT, 'lbmn_typography_p_fontsize', null, array('min' => '10', 'max' => '80', 'step' => '1')); render_slider_control('Line Height (px)', 'lbmn_typography', 150, LBMN_TYPOGRAPHY_P_LINEHEIGHT_DEFAULT, 'lbmn_typography_p_lineheight', null, array('min' => '5', 'max' => '100', 'step' => '1')); render_slider_control('Margin Bottom (px)', 'lbmn_typography', 160, LBMN_TYPOGRAPHY_P_MARGINBOTTOM_DEFAULT, 'lbmn_typography_p_marginbottom', null, array('min' => '0', 'max' => '100', 'step' => '1')); render_colorpickersliders_control('Font Color', 'lbmn_typography', 170, LBMN_TYPOGRAPHY_P_COLOR_DEFAULT, 'lbmn_typography_p_color'); render_subheader_control('Heading 1', 'lbmn_typography', 200); render_live_select_control('Font Family', 'lbmn_typography', 210, 'lbmn_typography_h1_font', $font_preset_options, LBMN_TYPOGRAPHY_H1_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_typography', 230, 'lbmn_typography_h1_fontweight', $font_weight_options, LBMN_TYPOGRAPHY_H1_FONTWEIGHT_DEFAULT); render_slider_control('Font Size (px)', 'lbmn_typography', 240, LBMN_TYPOGRAPHY_H1_FONTSIZE_DEFAULT, 'lbmn_typography_h1_fontsize', null, array('min' => '10', 'max' => '80', 'step' => '1')); render_slider_control('Line Height (px)', 'lbmn_typography', 250, LBMN_TYPOGRAPHY_H1_LINEHEIGHT_DEFAULT, 'lbmn_typography_h1_lineheight', null, array('min' => '5', 'max' => '100', 'step' => '1')); render_slider_control('Margin Bottom (px)', 'lbmn_typography', 260, LBMN_TYPOGRAPHY_H1_MARGINBOTTOM_DEFAULT, 'lbmn_typography_h1_marginbottom', null, array('min' => '0', 'max' => '100', 'step' => '1')); render_colorpickersliders_control('Font Color', 'lbmn_typography', 270, LBMN_TYPOGRAPHY_H1_COLOR_DEFAULT, 'lbmn_typography_h1_color'); render_subheader_control('Heading 2', 'lbmn_typography', 300); render_live_select_control('Font Family', 'lbmn_typography', 310, 'lbmn_typography_h2_font', $font_preset_options, LBMN_TYPOGRAPHY_H2_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_typography', 330, 'lbmn_typography_h2_fontweight', $font_weight_options, LBMN_TYPOGRAPHY_H2_FONTWEIGHT_DEFAULT); render_slider_control('Font Size (px)', 'lbmn_typography', 340, LBMN_TYPOGRAPHY_H2_FONTSIZE_DEFAULT, 'lbmn_typography_h2_fontsize', null, array('min' => '10', 'max' => '80', 'step' => '1')); render_slider_control('Line Height (px)', 'lbmn_typography', 350, LBMN_TYPOGRAPHY_H2_LINEHEIGHT_DEFAULT, 'lbmn_typography_h2_lineheight', null, array('min' => '5', 'max' => '100', 'step' => '1')); render_slider_control('Margin Bottom (px)', 'lbmn_typography', 360, LBMN_TYPOGRAPHY_H2_MARGINBOTTOM_DEFAULT, 'lbmn_typography_h2_marginbottom', null, array('min' => '0', 'max' => '100', 'step' => '1')); render_colorpickersliders_control('Font Color', 'lbmn_typography', 370, LBMN_TYPOGRAPHY_H2_COLOR_DEFAULT, 'lbmn_typography_h2_color'); render_subheader_control('Heading 3', 'lbmn_typography', 400); render_live_select_control('Font Family', 'lbmn_typography', 410, 'lbmn_typography_h3_font', $font_preset_options, LBMN_TYPOGRAPHY_H3_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_typography', 430, 'lbmn_typography_h3_fontweight', $font_weight_options, LBMN_TYPOGRAPHY_H3_FONTWEIGHT_DEFAULT); render_slider_control('Font Size (px)', 'lbmn_typography', 440, LBMN_TYPOGRAPHY_H3_FONTSIZE_DEFAULT, 'lbmn_typography_h3_fontsize', null, array('min' => '10', 'max' => '80', 'step' => '1')); render_slider_control('Line Height (px)', 'lbmn_typography', 450, LBMN_TYPOGRAPHY_H3_LINEHEIGHT_DEFAULT, 'lbmn_typography_h3_lineheight', null, array('min' => '5', 'max' => '100', 'step' => '1')); render_slider_control('Margin Bottom (px)', 'lbmn_typography', 460, LBMN_TYPOGRAPHY_H3_MARGINBOTTOM_DEFAULT, 'lbmn_typography_h3_marginbottom', null, array('min' => '0', 'max' => '100', 'step' => '1')); render_colorpickersliders_control('Font Color', 'lbmn_typography', 470, LBMN_TYPOGRAPHY_H3_COLOR_DEFAULT, 'lbmn_typography_h3_color'); render_subheader_control('Heading 4', 'lbmn_typography', 500); render_live_select_control('Font Family', 'lbmn_typography', 510, 'lbmn_typography_h4_font', $font_preset_options, LBMN_TYPOGRAPHY_H4_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_typography', 530, 'lbmn_typography_h4_fontweight', $font_weight_options, LBMN_TYPOGRAPHY_H4_FONTWEIGHT_DEFAULT); render_slider_control('Font Size (px)', 'lbmn_typography', 540, LBMN_TYPOGRAPHY_H4_FONTSIZE_DEFAULT, 'lbmn_typography_h4_fontsize', null, array('min' => '10', 'max' => '80', 'step' => '1')); render_slider_control('Line Height (px)', 'lbmn_typography', 550, LBMN_TYPOGRAPHY_H4_LINEHEIGHT_DEFAULT, 'lbmn_typography_h4_lineheight', null, array('min' => '5', 'max' => '100', 'step' => '1')); render_slider_control('Margin Bottom (px)', 'lbmn_typography', 560, LBMN_TYPOGRAPHY_H4_MARGINBOTTOM_DEFAULT, 'lbmn_typography_h4_marginbottom', null, array('min' => '0', 'max' => '100', 'step' => '1')); render_colorpickersliders_control('Font Color', 'lbmn_typography', 570, LBMN_TYPOGRAPHY_H4_COLOR_DEFAULT, 'lbmn_typography_h4_color'); render_subheader_control('Heading 5', 'lbmn_typography', 600); render_live_select_control('Font Family', 'lbmn_typography', 610, 'lbmn_typography_h5_font', $font_preset_options, LBMN_TYPOGRAPHY_H5_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_typography', 630, 'lbmn_typography_h5_fontweight', $font_weight_options, LBMN_TYPOGRAPHY_H5_FONTWEIGHT_DEFAULT); render_slider_control('Font Size (px)', 'lbmn_typography', 640, LBMN_TYPOGRAPHY_H5_FONTSIZE_DEFAULT, 'lbmn_typography_h5_fontsize', null, array('min' => '10', 'max' => '80', 'step' => '1')); render_slider_control('Line Height (px)', 'lbmn_typography', 650, LBMN_TYPOGRAPHY_H5_LINEHEIGHT_DEFAULT, 'lbmn_typography_h5_lineheight', null, array('min' => '5', 'max' => '100', 'step' => '1')); render_slider_control('Margin Bottom (px)', 'lbmn_typography', 660, LBMN_TYPOGRAPHY_H5_MARGINBOTTOM_DEFAULT, 'lbmn_typography_h5_marginbottom', null, array('min' => '0', 'max' => '100', 'step' => '1')); render_colorpickersliders_control('Font Color', 'lbmn_typography', 670, LBMN_TYPOGRAPHY_H5_COLOR_DEFAULT, 'lbmn_typography_h5_color'); render_subheader_control('Heading 6', 'lbmn_typography', 700); render_live_select_control('Font Family', 'lbmn_typography', 710, 'lbmn_typography_h6_font', $font_preset_options, LBMN_TYPOGRAPHY_H6_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_typography', 730, 'lbmn_typography_h6_fontweight', $font_weight_options, LBMN_TYPOGRAPHY_H6_FONTWEIGHT_DEFAULT); render_slider_control('Font Size (px)', 'lbmn_typography', 740, LBMN_TYPOGRAPHY_H6_FONTSIZE_DEFAULT, 'lbmn_typography_h6_fontsize', null, array('min' => '10', 'max' => '80', 'step' => '1')); render_slider_control('Line Height (px)', 'lbmn_typography', 750, LBMN_TYPOGRAPHY_H6_LINEHEIGHT_DEFAULT, 'lbmn_typography_h6_lineheight', null, array('min' => '5', 'max' => '100', 'step' => '1')); render_slider_control('Margin Bottom (px)', 'lbmn_typography', 760, LBMN_TYPOGRAPHY_H6_MARGINBOTTOM_DEFAULT, 'lbmn_typography_h6_marginbottom', null, array('min' => '0', 'max' => '100', 'step' => '1')); render_colorpickersliders_control('Font Color', 'lbmn_typography', 770, LBMN_TYPOGRAPHY_H6_COLOR_DEFAULT, 'lbmn_typography_h6_color'); /** * ---------------------------------------------------------------------- * Font Sets */ /** * http://www.google.com/fonts/#ReviewPlace:refine/Collection:Merriweather+Sans|Roboto+Condensed|Roboto|Oxygen|Dosis|Titillium+Web|Ubuntu|Lato|Raleway|Signika+Negative|Kreon|Open+Sans * http://www.google.com/fonts/#ReviewPlace:refine/Collection:Merriweather:400,300|Lora|Rufina|Playfair+Display|Libre+Baskerville|Domine|Noto+Serif */ $typography_standard_fonts = array('arial' => 'Sans-serif > Standard: Arial', 'helvetica' => 'Sans-serif > Standard: Helvetica', 'lucida-sans-unicode' => 'Sans-serif > Standard: Lucida Sans Unicode', 'century-gothic' => 'Sans-serif > Modern: Century Gothic', 'divider-1' => ' ', 'arial-narrow' => 'Sans-serif > Narrow: Arial Narrow', 'impact' => 'Sans-serif > Narrow Heavy: Impact', 'arial-black' => 'Sans-serif > Heavy: Arial Black', 'divider-2' => ' ', 'cambria' => 'Serif > Standard: Cambria', 'verdana' => 'Serif > Standard: Verdana', 'constantia' => 'Serif > Modern: Constantia', 'bookman-old-style' => 'Serif > Old Style: Bookman Old Style'); render_section_header('Font Presets', 255, 'lbmn_fonts', 'All the setings to make your website looks awesome.'); // Web font preset 1 render_subheader_control('Font Preset 1', 'lbmn_fonts', 100); render_select_control('Standard Font', 'lbmn_fonts', 110, 'lbmn_font_preset_standard_1', $typography_standard_fonts, LBMN_FONT_PRESET_STANDARD_1_DEFAULT); render_googlefonts_control('Google Web Font', 'lbmn_fonts', 120, 'lbmn_font_preset_googlefont_1', LBMN_FONT_PRESET_GOOGLEFONT_1_DEFAULT); render_text_control('Custom Web Font Name', 'lbmn_fonts', 130, '', 'lbmn_font_preset_webfont_1'); render_checkbox_control('Use Google Web Fonts', 'lbmn_fonts', 140, 1, 'lbmn_font_preset_usegooglefont_1'); $languages = apply_filters('wpml_active_languages', NULL, 'orderby=id&order=desc'); if (!empty($languages)) { foreach ($languages as $l) { $my_default_lang = apply_filters('wpml_default_language', NULL); if ($my_default_lang != $l['language_code']) { render_checkbox_control('Use another for ' . $l['translated_name'] . ' ', 'lbmn_fonts', 150, 0, 'lbmn_use_another_font_preset_switch_1_' . $l['language_code']); render_googlefonts_control('Google Web Font - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 150, 'lbmn_font_preset_googlefont_1_' . $l['language_code'] . '', LBMN_FONT_PRESET_GOOGLEFONT_1_DEFAULT); render_text_control('Custom Web Font Name - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 150, '', 'lbmn_font_preset_webfont_1_' . $l['language_code'] . ''); render_checkbox_control('Use Google Web Fonts - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 150, 1, 'lbmn_font_preset_usegooglefont_1_' . $l['language_code'] . ''); } } } // Web font preset 2 render_subheader_control('Font Preset 2', 'lbmn_fonts', 200); render_select_control('Standard Font', 'lbmn_fonts', 210, 'lbmn_font_preset_standard_2', $typography_standard_fonts, LBMN_FONT_PRESET_STANDARD_2_DEFAULT); render_googlefonts_control('Google Web Font', 'lbmn_fonts', 220, 'lbmn_font_preset_googlefont_2', LBMN_FONT_PRESET_GOOGLEFONT_2_DEFAULT); render_text_control('Custom Web Font Name', 'lbmn_fonts', 230, '', 'lbmn_font_preset_webfont_2'); render_checkbox_control('Use Google Web Fonts', 'lbmn_fonts', 240, 1, 'lbmn_font_preset_usegooglefont_2'); $languages = apply_filters('wpml_active_languages', NULL, 'orderby=id&order=desc'); if (!empty($languages)) { foreach ($languages as $l) { $my_default_lang = apply_filters('wpml_default_language', NULL); if ($my_default_lang != $l['language_code']) { render_checkbox_control('Use another for ' . $l['translated_name'] . ' ', 'lbmn_fonts', 250, 0, 'lbmn_use_another_font_preset_switch_2_' . $l['language_code']); render_googlefonts_control('Google Web Font - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 250, 'lbmn_font_preset_googlefont_2_' . $l['language_code'] . '', LBMN_FONT_PRESET_GOOGLEFONT_2_DEFAULT); render_text_control('Custom Web Font Name - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 250, '', 'lbmn_font_preset_webfont_2_' . $l['language_code'] . ''); render_checkbox_control('Use Google Web Fonts - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 250, 1, 'lbmn_font_preset_usegooglefont_2_' . $l['language_code'] . ''); } } } // Web font preset 3 render_subheader_control('Font Preset 3', 'lbmn_fonts', 300); render_select_control('Standard Font', 'lbmn_fonts', 310, 'lbmn_font_preset_standard_3', $typography_standard_fonts, LBMN_FONT_PRESET_STANDARD_3_DEFAULT); render_googlefonts_control('Google Web Font', 'lbmn_fonts', 320, 'lbmn_font_preset_googlefont_3', LBMN_FONT_PRESET_GOOGLEFONT_3_DEFAULT); render_text_control('Custom Web Font Name', 'lbmn_fonts', 330, '', 'lbmn_font_preset_webfont_3'); render_checkbox_control('Use Google Web Fonts', 'lbmn_fonts', 340, 1, 'lbmn_font_preset_usegooglefont_3'); $languages = apply_filters('wpml_active_languages', NULL, 'orderby=id&order=desc'); if (!empty($languages)) { foreach ($languages as $l) { $my_default_lang = apply_filters('wpml_default_language', NULL); if ($my_default_lang != $l['language_code']) { render_checkbox_control('Use another for ' . $l['translated_name'] . ' ', 'lbmn_fonts', 350, 0, 'lbmn_use_another_font_preset_switch_3_' . $l['language_code']); render_googlefonts_control('Google Web Font - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 350, 'lbmn_font_preset_googlefont_3_' . $l['language_code'] . '', LBMN_FONT_PRESET_GOOGLEFONT_3_DEFAULT); render_text_control('Custom Web Font Name - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 350, '', 'lbmn_font_preset_webfont_3_' . $l['language_code'] . ''); render_checkbox_control('Use Google Web Fonts - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 350, 1, 'lbmn_font_preset_usegooglefont_3_' . $l['language_code'] . ''); } } } // Web font preset 4 render_subheader_control('Font Preset 4', 'lbmn_fonts', 400); render_select_control('Standard Font', 'lbmn_fonts', 410, 'lbmn_font_preset_standard_4', $typography_standard_fonts, LBMN_FONT_PRESET_STANDARD_4_DEFAULT); render_googlefonts_control('Google Web Font', 'lbmn_fonts', 420, 'lbmn_font_preset_googlefont_4', LBMN_FONT_PRESET_GOOGLEFONT_4_DEFAULT); render_text_control('Custom Web Font Name', 'lbmn_fonts', 430, '', 'lbmn_font_preset_webfont_4'); render_checkbox_control('Use Google Web Fonts', 'lbmn_fonts', 440, 1, 'lbmn_font_preset_usegooglefont_4'); $languages = apply_filters('wpml_active_languages', NULL, 'orderby=id&order=desc'); if (!empty($languages)) { foreach ($languages as $l) { $my_default_lang = apply_filters('wpml_default_language', NULL); if ($my_default_lang != $l['language_code']) { render_checkbox_control('Use another for ' . $l['translated_name'] . ' ', 'lbmn_fonts', 450, 0, 'lbmn_use_another_font_preset_switch_4_' . $l['language_code']); render_googlefonts_control('Google Web Font - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 450, 'lbmn_font_preset_googlefont_4_' . $l['language_code'] . '', LBMN_FONT_PRESET_GOOGLEFONT_4_DEFAULT); render_text_control('Custom Web Font Name - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 450, '', 'lbmn_font_preset_webfont_4_' . $l['language_code'] . ''); render_checkbox_control('Use Google Web Fonts - ' . $l['translated_name'] . ' ', 'lbmn_fonts', 450, 1, 'lbmn_font_preset_usegooglefont_4_' . $l['language_code'] . ''); } } } // Advanced font settings render_subheader_control('Additional character sets', 'lbmn_fonts', 500); render_checkbox_control('Latin Extended', 'lbmn_fonts', 510, 0, 'lbmn_font_characterset_latinextended'); render_checkbox_control('Cyrillic', 'lbmn_fonts', 530, 0, 'lbmn_font_characterset_cyrillic'); render_checkbox_control('Cyrillic Extended', 'lbmn_fonts', 540, 0, 'lbmn_font_characterset_cyrillicextended'); render_checkbox_control('Greek', 'lbmn_fonts', 550, 0, 'lbmn_font_characterset_greek'); render_checkbox_control('Greek Extended', 'lbmn_fonts', 560, 0, 'lbmn_font_characterset_greekextended'); render_checkbox_control('Vietnamese', 'lbmn_fonts', 570, 0, 'lbmn_font_characterset_vietnamese'); /** * ---------------------------------------------------------------------- * "Call to action" section */ render_section_header('Call-to-action area', 260, 'lbmn_calltoaction', 'Site-wide call to action area settings'); render_checkbox_control('Enable', 'lbmn_calltoaction', 20, 1, 'lbmn_calltoaction_switch'); // Top panel switch render_slider_control('Height', 'lbmn_calltoaction', 22, LBMN_CALLTOACTION_HEIGHT_DEFAULT, 'lbmn_calltoaction_height', null, array('min' => '60', 'max' => '200', 'step' => '2')); // Message elements render_text_control('Call to action Message', 'lbmn_calltoaction', 40, LBMN_CALLTOACTION_MESSAGE_DEFAULT, 'lbmn_calltoaction_message'); // Call to action render_text_control('Link', 'lbmn_calltoaction', 70, LBMN_CALLTOACTION_URL_DEFAULT, 'lbmn_calltoaction_url'); // Font render_live_select_control('Font Family', 'lbmn_calltoaction', 80, 'lbmn_calltoaction_font', $font_preset_options, LBMN_CALLTOACTION_FONT_DEFAULT); render_live_select_control('Font Weight', 'lbmn_calltoaction', 90, 'lbmn_calltoaction_fontweight', $font_weight_options, LBMN_CALLTOACTION_FONTWEIGHT_DEFAULT); render_slider_control('Font Size (px)', 'lbmn_calltoaction', 100, LBMN_CALLTOACTION_FONTSIZE_DEFAULT, 'lbmn_calltoaction_fontsize', null, array('min' => '10', 'max' => '80', 'step' => '1')); // Colors render_colorpickersliders_control('Background Color', 'lbmn_calltoaction', 110, LBMN_CALLTOACTION_BACKGROUNDCOLOR_DEFAULT); render_colorpickersliders_control('Text Color', 'lbmn_calltoaction', 120, LBMN_CALLTOACTION_TXTCOLOR_DEFAULT); render_colorpickersliders_control('Background Color', 'lbmn_calltoaction', 130, LBMN_CALLTOACTION_BACKGROUNDCOLOR_HOVER_DEFAULT, 'lbmn_calltoaction_backgroundcolor_hover'); render_colorpickersliders_control('Text Color', 'lbmn_calltoaction', 140, LBMN_CALLTOACTION_TXTCOLOR_HOVER_DEFAULT, 'lbmn_calltoaction_textcolor_hover'); /** * ---------------------------------------------------------------------- * Website footer section */ // Set array with all the footers listed // See /inc/functions-extras.php for lbmn_return_all_footers() $footer_designs_options = lbmn_return_all_footers(); $footer_designs_options = array('disable' => __('Disable', 'lbmn')) + $footer_designs_options; // array_unshift($footer_designs_options, 'disabled' => __('Disable','lbmn')); // $footer_designs_options['disabled'] = __('Disable','lbmn'); // Get default footer custom post id $footer_design_default = get_page_by_title(LBMN_FOOTER_DESIGN_TITLE_DEFAULT, 'ARRAY_A', 'lbmn_footer'); if (isset($footer_design_default)) { $footer_design_default = $footer_design_default['ID']; } else { $footer_design_default = ''; } render_section_header('Website Footer', 620, 'lbmn_footer', 'All the setings to make your footer looks awesome.'); render_select_control('Default Footer Design', 'lbmn_footer', 10, 'lbmn_footer_design', $footer_designs_options, $footer_design_default); /** * ---------------------------------------------------------------------- * Other settings */ // $footer_designs_options = array('disable' => __('Disable','lbmn')); render_section_header('Advanced Settings', 800, 'lbmn_advanced', ''); render_checkbox_control('Enable Page Preloading Effect', 'lbmn_advanced', 20, 1, 'lbmn_advanced_preloader'); render_text_control('Envato Purchase Code (activates automatic theme updates):', 'lbmn_advanced', 40, '', 'lbmn_purchase_code', 'option'); /** * ---------------------------------------------------------------------- * Remove some standard WP sections from Theme Customizer */ $wp_customize->remove_section('title_tagline'); $wp_customize->remove_section('nav'); $wp_customize->remove_section('static_front_page'); $wp_customize->remove_section('background_image'); }
* * ------------------------------------------------------------------- * * Send your ideas on code improvement or new hook requests using * contact form on http://themeforest.net/user/lumbermandesigns */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly $prefix = 'lbmn_'; global $meta_boxes; $meta_boxes = array(); // Set array with all the footers listed // See /inc/functions-extras.php for lbmn_return_all_footers() $footer_posts = lbmn_return_all_footers(); /** * ---------------------------------------------------------------------- * Page settings meta box */ $meta_boxes[] = array('id' => 'lbmn-page-settings', 'title' => __('Page Design Settings', 'lbmn'), 'pages' => array('page'), 'context' => 'side', 'priority' => 'high', 'autosave' => true, 'fields' => array(array('name' => '', 'id' => "{$prefix}page_title_settings", 'type' => 'checkbox_list', 'options' => array('menuoverlay' => '<strong>' . __('Menu cover content', 'lbmn') . '</strong>')), array('name' => __('Custom footer', 'lbmn'), 'id' => "{$prefix}custom_footer_id", 'type' => 'select', 'options' => $footer_posts, 'multiple' => false, 'std' => '', 'placeholder' => __('Select an Item', 'lbmn')))); /** * ---------------------------------------------------------------------- * Register defined meta boxes */ /** * Register meta boxes * * @return void */ function lbmn_register_custom_meta_boxes()