/** * Defines customizer options * * @package Customizer Library Demo */ function customizer_library_kaira_options() { // Theme defaults $primary_color = '#6f9d9f'; $secondary_color = '#c54513'; $body_font_color = '#7b7d80'; $heading_font_color = '#5a5a5a'; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Adds the sections to the $options array $options['sections'] = $sections; // Logo $section = 'kra-favicon'; $sections[] = array('id' => $section, 'title' => __('Favicon', 'levii'), 'priority' => '10', 'description' => __('Add a favicon to your website', 'levii')); $options['kra-header-favicon'] = array('id' => 'kra-header-favicon', 'label' => __('Favicon', 'levii'), 'section' => $section, 'type' => 'image', 'default' => ''); // Header Settings $section = 'kra-header'; $sections[] = array('id' => $section, 'title' => __('Header Options', 'levii'), 'priority' => '30'); $options['kra-header-profile-img'] = array('id' => 'kra-header-profile-img', 'label' => __('Profile Image', 'levii'), 'section' => $section, 'type' => 'image', 'description' => __('Upload a small square image, this image size is set to 104px by 104px', 'levii'), 'default' => ''); $options['kra-header-search'] = array('id' => 'kra-header-search', 'label' => __('Show Search', 'levii'), 'section' => $section, 'type' => 'checkbox', 'description' => __('Enable to a slogan for your site. This uses the site Tagline', 'levii'), 'default' => 1); // Upsell Button One $options['kra-upsell-one'] = array('id' => 'kra-upsell-one', 'label' => __('Enable header social icons', 'levii'), 'section' => $section, 'type' => 'upsell'); // Colors $section = 'kra-styling'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Styling Options', 'levii'), 'priority' => '40'); $options['kra-main-color'] = array('id' => 'kra-main-color', 'label' => __('Main Color', 'levii'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['kra-main-color-hover'] = array('id' => 'kra-main-color-hover', 'label' => __('Secondary Color', 'levii'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); $options['kra-body-font'] = array('id' => 'kra-body-font', 'label' => __('Body Font', 'levii'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Open Sans'); $options['kra-body-font-color'] = array('id' => 'kra-body-font-color', 'label' => __('Body Font Color', 'levii'), 'section' => $section, 'type' => 'color', 'default' => $body_font_color); $options['kra-heading-font'] = array('id' => 'kra-heading-font', 'label' => __('Headings Font', 'levii'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Roboto'); $options['kra-heading-font-color'] = array('id' => 'kra-heading-font-color', 'label' => __('Heading Font Color', 'levii'), 'section' => $section, 'type' => 'color', 'default' => $heading_font_color); // Blog Settings $section = 'kra-blog'; $sections[] = array('id' => $section, 'title' => __('Blog Options', 'levii'), 'priority' => '160'); // Upsell Button Two $options['kra-upsell-two'] = array('id' => 'kra-upsell-two', 'label' => __('Blog Post Layout', 'levii'), 'section' => $section, 'type' => 'upsell'); $options['kra-blog-cats'] = array('id' => 'kra-blog-cats', 'label' => __('Exclude Blog Categories', 'levii'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the ID\'s of the post categories you\'d like to EXCLUDE from the Blog, enter only the ID\'s with a minus sign (-) before them, separated by a comma (,)<br />Eg: "-13, -17, -19"<br />If you enter the ID\'s without the minus then it\'ll show ONLY posts in those categories.', 'levii')); // Social Settings $section = 'kra-social'; $sections[] = array('id' => $section, 'title' => __('Social Links', 'levii'), 'priority' => '160'); // Upsell Button Three $options['kra-upsell-three'] = array('id' => 'kra-upsell-three', 'label' => __('Enable Social Icons', 'levii'), 'section' => $section, 'type' => 'upsell'); // Site Text Settings $section = 'kra-website'; $sections[] = array('id' => $section, 'title' => __('Website Text', 'levii'), 'priority' => '160'); // Upsell Button Four $options['kra-upsell-four'] = array('id' => 'kra-upsell-four', 'label' => __('Site Copy Text', 'levii'), 'section' => $section, 'type' => 'upsell'); $options['kra-website-error-head'] = array('id' => 'kra-website-error-head', 'label' => __('404 Error Page Heading', 'levii'), 'section' => $section, 'type' => 'text', 'default' => __('Oops! That page can\'t be found.', 'levii'), 'description' => __('Enter the heading for the 404 Error page', 'levii')); $options['kra-website-error-msg'] = array('id' => 'kra-website-error-msg', 'label' => __('Error 404 Message', 'levii'), 'section' => $section, 'type' => 'textarea', 'default' => __('The page you are looking for can\'t be found. Please select one of the options below.', 'levii'), 'description' => __('Enter the default text on the 404 error page (Page not found)', 'levii')); $options['kra-website-nosearch-msg'] = array('id' => 'kra-website-nosearch-msg', 'label' => __('No Search Results', 'levii'), 'section' => $section, 'type' => 'textarea', 'default' => __('Sorry, but nothing matched your search terms. Please try again with some different keywords or return to home.', 'levii'), 'description' => __('Enter the default text for when no search results are found', 'levii')); // Adds the sections to the $options array $options['sections'] = $sections; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
/** * Defines customizer options * * @package Customizer Library Demo */ function customizer_library_demo_options() { // Theme defaults $primary_color = '#5bc08c'; $secondary_color = '#666'; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Stores all the panels to be added $panels = array(); // Adds the sections to the $options array $options['sections'] = $sections; // Logo $section = 'logo'; $sections[] = array('id' => $section, 'title' => __('Image Example', 'demo'), 'priority' => '30', 'description' => __('Example section description.', 'demo')); $options['logo'] = array('id' => 'logo', 'label' => __('Logo', 'demo'), 'section' => $section, 'type' => 'image', 'default' => ''); // File Upload $section = 'upload'; $sections[] = array('id' => $section, 'title' => __('File Upload Example', 'demo'), 'priority' => '30', 'description' => __('Example section description.', 'demo')); $options['upload'] = array('id' => 'upload', 'label' => __('upload', 'demo'), 'section' => $section, 'type' => 'upload', 'default' => ''); // Colors $section = 'colors'; $sections[] = array('id' => $section, 'title' => __('Colors', 'demo'), 'priority' => '80'); $options['primary-color'] = array('id' => 'primary-color', 'label' => __('Primary Color', 'demo'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['secondary-color'] = array('id' => 'secondary-color', 'label' => __('Secondary Color', 'demo'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); $options['border'] = array('id' => 'border', 'label' => __('Border Color', 'demo'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); // Typography $section = 'typography'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Typography', 'demo'), 'priority' => '80'); $options['primary-font'] = array('id' => 'primary-font', 'label' => __('Primary Font', 'demo'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Monoton'); $options['secondary-font'] = array('id' => 'secondary-font', 'label' => __('Secondary Font', 'demo'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Merriweather'); // More Examples $section = 'examples'; $sections[] = array('id' => $section, 'title' => __('More Examples', 'demo'), 'priority' => '90'); $options['example-text'] = array('id' => 'example-text', 'label' => __('Example Text Input', 'demo'), 'section' => $section, 'type' => 'text'); $options['example-url'] = array('id' => 'example-url', 'label' => __('Example URL Input', 'demo'), 'section' => $section, 'type' => 'url'); $options['example-checkbox'] = array('id' => 'example-checkbox', 'label' => __('Example Checkbox', 'demo'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); $choices = array('choice-1' => 'Choice One', 'choice-2' => 'Choice Two', 'choice-3' => 'Choice Three'); $options['example-select'] = array('id' => 'example-select', 'label' => __('Example Select', 'demo'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'choice-1'); $options['example-radio'] = array('id' => 'example-radio', 'label' => __('Example Radio', 'demo'), 'section' => $section, 'type' => 'radio', 'choices' => $choices, 'default' => 'choice-1'); $options['example-textarea'] = array('id' => 'example-textarea', 'label' => __('Example Textarea', 'demo'), 'section' => $section, 'type' => 'textarea', 'default' => __('Example textarea text.', 'demo')); $options['example-range'] = array('id' => 'example-range', 'label' => __('Example Range Input', 'demo'), 'section' => $section, 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 10, 'step' => 1, 'style' => 'color: #0a0')); // Panel Example $panel = 'panel'; $panels[] = array('id' => $panel, 'title' => __('Panel Examples', 'demo'), 'priority' => '100'); $section = 'panel-section'; $sections[] = array('id' => $section, 'title' => __('Panel Section', 'demo'), 'priority' => '10', 'panel' => $panel); $options['example-panel-text'] = array('id' => 'example-panel-text', 'label' => __('Example Text Input', 'demo'), 'section' => $section, 'type' => 'text'); // Adds the sections to the $options array $options['sections'] = $sections; // Adds the panels to the $options array $options['panels'] = $panels; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
function bfg_customizer_options() { // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Stores all the panels to be added $panels = array(); // Adds the sections to the $options array $options['sections'] = $sections; // Logo $section = 'logo'; $sections[] = array('id' => $section, 'title' => __('Logo', 'bfg'), 'priority' => '25'); $options['logo'] = array('id' => 'logo', 'label' => __('Upload logo', 'bfg'), 'type' => 'upload', 'section' => $section, 'default' => ''); // Navigation Extras $section = 'navextra'; $choices = array('date' => __('Date', 'bfg'), 'search' => __('Search Form', 'bfg')); $sections[] = array('id' => $section, 'title' => __('Navigation Extras', 'bfg'), 'priority' => '30'); $options['navextra'] = array('id' => 'navextra', 'label' => __('Display navigation extras', 'bfg'), 'section' => $section, 'type' => 'checkbox', 'default' => false); $options['select'] = array('id' => 'select', 'label' => __('Select Navigation Extra', 'bfg'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'search'); // Typography $section = 'typography'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Typography', 'bfg'), 'priority' => '30'); $options['custom-font'] = array('id' => 'custom-font', 'label' => __('Enable custom font', 'bfg'), 'section' => $section, 'type' => 'checkbox', 'default' => false); $options['heading-font'] = array('id' => 'heading-font', 'label' => __('Heading Font', 'bfg'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Raleway'); $options['body-font'] = array('id' => 'body-font', 'label' => __('Body Font', 'bfg'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Roboto'); // Footer $section = 'footer'; $sections[] = array('id' => $section, 'title' => __('Footer', 'bfg'), 'priority' => '35', 'description' => __('', 'bfg')); $options['footer'] = array('id' => 'creds', 'label' => __('Copyright', 'bfg'), 'section' => $section, 'type' => 'text', 'default' => ''); // Adds the sections to the $options array $options['sections'] = $sections; // Adds the panels to the $options array $options['panels'] = $panels; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
/** * Defines customizer options * * @package Customizer_Library */ function customizer_library_rescue_options() { // Theme defaults $primary_color = '#e8554e'; $secondary_color = '#666'; $top_header = '#2c3135'; $primary_green = '#1fa67a'; $primary_green_hover = '#198562'; $donation_bg = '#f1c40f'; $donation_border = '#e2b709'; $home_top_widgets_bg = '#34495e'; $home_top_widgets_hover = '#a2da08'; $social_icon = '#aaaaaa'; $white = '#ffffff'; $top_nav_link_color = '#888888'; // Categories $categories = get_categories(); $cats = array(); $i = 0; foreach ($categories as $category) { if ($i == 0) { $default = $category->slug; $i++; } $cats[$category->slug] = $category->name; } // Animations $animate = array('none' => __('none', 'rescue'), 'bounce' => __('bounce', 'rescue'), 'flash' => __('flash', 'rescue'), 'pulse' => __('pulse', 'rescue'), 'shake' => __('shake', 'rescue'), 'wobble' => __('wobble', 'rescue'), 'bounceIn' => __('bounceIn', 'rescue'), 'bounceInDown' => __('bounceInDown', 'rescue'), 'bounceInLeft' => __('bounceInLeft', 'rescue'), 'bounceInRight' => __('bounceInRight', 'rescue'), 'bounceInUp' => __('bounceInUp', 'rescue'), 'fadeIn' => __('fadeIn', 'rescue'), 'fadeInDown' => __('fadeInDown', 'rescue'), 'fadeInDownBig' => __('fadeInDownBig', 'rescue'), 'fadeInLeft' => __('fadeInLeft', 'rescue'), 'fadeInLeftBig' => __('fadeInLeftBig', 'rescue'), 'fadeInRight' => __('fadeInRight', 'rescue'), 'fadeInRightBig' => __('fadeInRightBig', 'rescue'), 'fadeInUp' => __('fadeInUp', 'rescue'), 'fadeInUpBig' => __('fadeInUpBig', 'rescue'), 'lightSpeedIn' => __('lightSpeedIn', 'rescue'), 'lightSpeedOut' => __('lightSpeedOut', 'rescue'), 'rotateIn' => __('rotateIn', 'rescue'), 'rotateInDownLeft' => __('rotateInDownLeft', 'rescue'), 'rotateInDownRight' => __('rotateInDownRight', 'rescue'), 'rotateInUpLeft' => __('rotateInUpLeft', 'rescue'), 'rotateInUpRight' => __('rotateInUpRight', 'rescue'), 'zoomIn' => __('zoomIn', 'rescue'), 'zoomInDown' => __('zoomInDown', 'rescue'), 'zoomInLeft' => __('zoomInLeft', 'rescue'), 'zoomInRight' => __('zoomInRight', 'rescue'), 'zoomInUp' => __('zoomInUp', 'rescue')); // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Image path defaults= $imagepath = get_template_directory_uri() . '/img/'; // Adds the sections to the $options array $options['sections'] = $sections; // Header $section = 'header'; $sections[] = array('id' => $section, 'title' => __('Header', 'rescue'), 'priority' => '30', 'description' => __('Header area options', 'rescue'), 'panel' => 'theme_options'); $options['header_logo'] = array('id' => 'header_logo', 'label' => __('Logo', 'rescue'), 'section' => $section, 'type' => 'upload', 'default' => ''); $options['header_top_bg_color'] = array('id' => 'header_top_bg_color', 'label' => __('Top header background color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $top_header, 'transport' => 'postMessage'); $options['header_top_nav_link_color'] = array('id' => 'header_top_nav_link_color', 'label' => __('Top header Navigation Link Color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $top_nav_link_color, 'transport' => 'postMessage'); $options['header_top_nav_link_color_hover'] = array('id' => 'header_top_nav_link_color_hover', 'label' => __('Top header Navigation Link Hover Color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $white); $options['header_bottom_bg_color'] = array('id' => 'header_bottom_bg_color', 'label' => __('Bottom header background color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $primary_green, 'transport' => 'postMessage'); $options['header_bottom_nav_link_color'] = array('id' => 'header_bottom_nav_link_color', 'label' => __('Bottom Header Navigation Link Color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $white, 'transport' => 'postMessage'); $options['header_bottom_nav_dropdown_indicator'] = array('id' => 'header_bottom_nav_dropdown_indicator', 'label' => __('Check to remove the dropdown indicator circle', 'rescue'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); $options['donation_button_show'] = array('id' => 'donation_button_show', 'label' => __('Display donation button', 'rescue'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); $options['donate_button_text'] = array('id' => 'donate_button_text', 'label' => __('Text for donation button', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => 'Donate Now', 'transport' => 'postMessage'); $options['donation_button_link'] = array('id' => 'donation_button_link', 'label' => __('Link for donation button', 'rescue'), 'section' => $section, 'type' => 'text'); $options['donation_button_target'] = array('id' => 'donation_button_target', 'label' => __('Select to open link in new window.', 'rescue'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); $options['donate_bg_color'] = array('id' => 'donate_bg_color', 'label' => __('Select the donation button color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $donation_bg, 'transport' => 'postMessage'); $options['donate_border_color'] = array('id' => 'donate_border_color', 'label' => __('Select the donation button bottom border color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $donation_border, 'transport' => 'postMessage'); $options['donate_bg_color_hover'] = array('id' => 'donate_bg_color_hover', 'label' => __('Select the donation button hover color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $donation_border); $options['donate_border_color_hover'] = array('id' => 'donate_border_color_hover', 'label' => __('Select the donation button bottom border hover color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $donation_border); $options['donate_button_animate'] = array('id' => 'donate_button_animate', 'label' => __('Donation button animation effect', 'rescue'), 'section' => $section, 'type' => 'select', 'choices' => $animate, 'default' => 'fadeInRight'); // Home Top Widgets $section = 'home-top-widgets'; $sections[] = array('id' => $section, 'title' => __('Home Top Widgets', 'rescue'), 'priority' => '40', 'description' => __('This section will display on the home page once widgets are added to it in the widgets section.', 'rescue'), 'panel' => 'theme_options'); $options['home_top_widgets_bg'] = array('id' => 'home_top_widgets_bg', 'label' => __('Select the home top widgets background color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $home_top_widgets_bg, 'transport' => 'postMessage'); $options['home_top_widgets_hover'] = array('id' => 'home_top_widgets_hover', 'label' => __('Select the home top widgets text hover color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $home_top_widgets_hover); $options['home_top_widgets_animation'] = array('id' => 'home_top_widgets_animation', 'label' => __('Home top widget section animation effect', 'rescue'), 'section' => $section, 'type' => 'select', 'choices' => $animate, 'default' => 'none'); // Home Events $section = 'home-events'; $sections[] = array('id' => $section, 'title' => __('Home Events', 'rescue'), 'priority' => '40', 'description' => __('Home events section options', 'rescue'), 'panel' => 'theme_options'); $options['home_events_animation'] = array('id' => 'home_events_animation', 'label' => __('Home events section animation effect', 'rescue'), 'section' => $section, 'type' => 'select', 'choices' => $animate, 'default' => 'none'); $options['home_events_img_border'] = array('id' => 'home_events_img_border', 'label' => __('Select to display event images as square.', 'rescue'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); // Home News $section = 'home-news'; $sections[] = array('id' => $section, 'title' => __('Home News', 'rescue'), 'priority' => '40', 'description' => __('Home blog posts options', 'rescue'), 'panel' => 'theme_options'); $options['home_news_show'] = array('id' => 'home_news_show', 'label' => __('Display home news section', 'rescue'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); $options['home_news_title'] = array('id' => 'home_news_title', 'label' => __('Title of the home page news section', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => 'Latest News Releases', 'transport' => 'postMessage'); $options['home_blog_category'] = array('id' => 'home_blog_category', 'label' => __('Category for your home blog posts', 'rescue'), 'section' => $section, 'type' => 'select', 'choices' => $cats); $options['home_blog_num'] = array('id' => 'home_blog_num', 'label' => __('Number of posts to display', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => '1'); $options['home_news_link'] = array('id' => 'home_news_link', 'label' => __('Link to blog page', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['home_news_button_text'] = array('id' => 'home_news_button_text', 'label' => __('Blog page button text', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => 'View all news', 'transport' => 'postMessage'); $options['home_news_animation'] = array('id' => 'home_news_animation', 'label' => __('Home news section animation effect', 'rescue'), 'section' => $section, 'type' => 'select', 'choices' => $animate, 'default' => 'none'); // Home Gallery $section = 'home-gallery'; $sections[] = array('id' => $section, 'title' => __('Home Gallery', 'rescue'), 'priority' => '50', 'description' => __('Activate the Rescue Portfolio plugin and add portfolio posts to display gallery images on the home page', 'rescue'), 'panel' => 'theme_options'); $options['home_gallery_show'] = array('id' => 'home_gallery_show', 'label' => __('Display home gallery section', 'rescue'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); $options['home_gallery_title'] = array('id' => 'home_gallery_title', 'label' => __('Title of the home page image gallery section', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => 'Latest Gallery Images', 'transport' => 'postMessage'); $options['home_gallery_qty'] = array('id' => 'home_gallery_qty', 'label' => __('Number of gallery images to display on home page', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => '3'); $options['home_gallery_link'] = array('id' => 'home_gallery_link', 'label' => __('Enter the link to your gallery page', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['home_gallery_button_text'] = array('id' => 'home_gallery_button_text', 'label' => __('Enter the text for your gallery button', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => 'View All Images', 'transport' => 'postMessage'); $options['home_gallery_animation'] = array('id' => 'home_gallery_animation', 'label' => __('Home gallery section animation effect', 'rescue'), 'section' => $section, 'type' => 'select', 'choices' => $animate, 'default' => 'none'); // Typography $section = 'typography'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Typography', 'rescue'), 'priority' => '60', 'panel' => 'theme_options'); $options['primary-font'] = array('id' => 'primary-font', 'label' => __('Header Font', 'rescue'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Open Sans', 'transport' => 'postMessage'); $options['primary-font-color'] = array('id' => 'primary-font-color', 'label' => __('Header Font Color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $home_top_widgets_bg, 'transport' => 'postMessage'); $options['secondary-font'] = array('id' => 'secondary-font', 'label' => __('Paragraph Font', 'rescue'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Open Sans', 'transport' => 'postMessage'); $options['link_hover_color'] = array('id' => 'link_hover_color', 'label' => __('Post/Page Content link hover color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $primary_green); $options['button_color'] = array('id' => 'button_color', 'label' => __('Sitewide buttons color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $primary_green, 'transport' => 'postMessage'); $options['main_button_hover'] = array('id' => 'main_button_hover', 'label' => __('Sitewide button hover color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $primary_green_hover); // Footer $section = 'footer'; $sections[] = array('id' => $section, 'title' => __('Footer', 'rescue'), 'priority' => '70', 'description' => __('Footer area options', 'rescue'), 'panel' => 'theme_options'); $options['footer_bg_color'] = array('id' => 'footer_bg_color', 'label' => __('Footer background color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $top_header, 'transport' => 'postMessage'); $options['footer_social_animation'] = array('id' => 'footer_social_animation', 'label' => __('Home social icons animation effect', 'rescue'), 'section' => $section, 'type' => 'select', 'choices' => $animate, 'default' => 'none'); $options['footer_social_color'] = array('id' => 'footer_social_color', 'label' => __('Social Icons Color', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $social_icon, 'transport' => 'postMessage'); $options['footer_social_color_hover'] = array('id' => 'footer_social_color_hover', 'label' => __('Social Icons Color Hover', 'rescue'), 'section' => $section, 'type' => 'color', 'default' => $white); $options['twitter_link'] = array('id' => 'twitter_link', 'label' => __('Enter a Twitter link', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['facebook_link'] = array('id' => 'facebook_link', 'label' => __('Enter a Facebook link', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['google_link'] = array('id' => 'google_link', 'label' => __('Enter a Google link', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['instagram_link'] = array('id' => 'instagram_link', 'label' => __('Enter a Instagram link', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['vimeo_link'] = array('id' => 'vimeo_link', 'label' => __('Enter a Vimeo link', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['youtube_link'] = array('id' => 'youtube_link', 'label' => __('Enter a Youtube link', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['pinterest_link'] = array('id' => 'pinterest_link', 'label' => __('Enter a Pinterest link', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['linkedin_link'] = array('id' => 'linkedin_link', 'label' => __('Enter a LinkedIn link', 'rescue'), 'section' => $section, 'type' => 'text', 'default' => ''); $options['footer_copyright'] = array('id' => 'footer_copyright', 'label' => __('Enter footer copyright text.', 'rescue'), 'section' => $section, 'type' => 'textarea', 'default' => '© Copyright'); // Custom CSS $section = 'Custom-css'; $sections[] = array('id' => $section, 'title' => __('Custom CSS', 'rescue'), 'priority' => '80', 'description' => __('Enter custom CSS styles', 'rescue'), 'panel' => 'theme_options'); $options['custom_css_textarea'] = array('id' => 'custom_css_textarea', 'label' => __('Custom CSS', 'rescue'), 'section' => $section, 'type' => 'textarea', 'default' => ''); // Adds the sections to the $options array $options['sections'] = $sections; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
<?php //----------------------TOPBAR SECTION---------------------------------- //============================HEADER - LOGO SECTION================================= // Site Title Font Family $wp_customize->add_setting('optimizer[logo_font_id][font-family]', array('type' => 'option', 'default' => 'Open Sans', 'sanitize_callback' => 'esc_attr', 'transport' => 'postMessage')); $wp_customize->add_control('logo_font_family', array('type' => 'select', 'label' => __('Family', 'optimizer'), 'section' => 'headlogo_section', 'settings' => 'optimizer[logo_font_id][font-family]', 'choices' => customizer_library_get_font_choices())); // Site Title Font Subsets $wp_customize->add_setting('optimizer[logo_font_id][subsets]', array('type' => 'option', 'default' => 'latin', 'sanitize_callback' => 'esc_attr', 'transport' => 'postMessage')); $wp_customize->add_control('logo_font_subsets', array('type' => 'select', 'label' => __('Subsets', 'optimizer'), 'section' => 'headlogo_section', 'settings' => 'optimizer[logo_font_id][subsets]', 'choices' => customizer_library_get_google_font_subsets())); //Site Title Font Size $wp_customize->add_setting('optimizer[logo_font_id][font-size]', array('type' => 'option', 'default' => '36px', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage')); $wp_customize->add_control('logo_font_size', array('type' => 'text', 'label' => __('Site Title Font Size', 'optimizer'), 'section' => 'headlogo_section', 'settings' => 'optimizer[logo_font_id][font-size]', 'input_attrs' => array('class' => 'mini_control'))); //Site Title Text Color $wp_customize->add_setting('optimizer[logo_color_id]', array('type' => 'option', 'default' => '#555555', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'logo_color_id', array('label' => __('Site Title Color', 'optimizer'), 'section' => 'headlogo_section', 'settings' => 'optimizer[logo_color_id]'))); //LOGO UPLOAD FIELD $wp_customize->add_setting('optimizer[logo_image_id][url]', array('type' => 'option', 'default' => '', 'sanitize_callback' => 'esc_url_raw')); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo_image_id', array('label' => __('Logo Image *', 'optimizer'), 'section' => 'headlogo_section', 'settings' => 'optimizer[logo_image_id][url]'))); //============================HEADER - MENU SECTION================================= //MENU TEXT COLOR $wp_customize->add_setting('optimizer[menutxt_color_id]', array('type' => 'option', 'default' => '#888888', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'menutxt_color_id', array('label' => __('Menu Text Color', 'optimizer'), 'section' => 'headmenu_section', 'settings' => 'optimizer[menutxt_color_id]'))); //MENU HOVER TEXT COLOR $wp_customize->add_setting('optimizer[menutxt_color_hover]', array('type' => 'option', 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'menutxt_color_hover', array('label' => __('Menu Hover Text Color', 'optimizer'), 'section' => 'headmenu_section', 'settings' => 'optimizer[menutxt_color_hover]'))); //MENU ACTIVE TEXT COLOR $wp_customize->add_setting('optimizer[menutxt_color_active]', array('type' => 'option', 'default' => '#3590ea', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'menutxt_color_active', array('label' => __('Menu Active Text Color', 'optimizer'), 'section' => 'headmenu_section', 'settings' => 'optimizer[menutxt_color_active]'))); //MENU TEXT SIZE $wp_customize->add_setting('optimizer[menu_size_id]', array('type' => 'option', 'default' => '14px', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
/** * Sanitize a font choice. * * @since 1.0.0. * * @param string $value The font choice. * @return string The sanitized font choice. */ function customizer_library_sanitize_font_choice($value) { if (is_int($value)) { // The array key is an integer, so the chosen option is a heading, not a real choice return ''; } else { if (array_key_exists($value, customizer_library_get_font_choices())) { return $value; } else { return ''; } } }
/** * Defines customizer options * * @package Customizer Library smtm */ function customizer_library_smtm_options() { // Theme defaults $primary_color = '#5bc08c'; $secondary_color = '#666'; $header_color = '#FF6347'; $footer_color = '#319475'; $background_color = '#f9f9f9'; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Stores all the panels to be added $panels = array(); // Adds the sections to the $options array $options['sections'] = $sections; // // Logo // $section = 'logo'; // // $sections[] = array( // 'id' => $section, // 'title' => __( 'Image Example', 'smtm' ), // 'priority' => '30', // 'description' => __( 'Example section description.', 'smtm' ) // ); // // $options['logo'] = array( // 'id' => 'logo', // 'label' => __( 'Logo', 'smtm' ), // 'section' => $section, // 'type' => 'image', // 'default' => '' // ); // // // File Upload // $section = 'upload'; // // $sections[] = array( // 'id' => $section, // 'title' => __( 'File Upload Example', 'smtm' ), // 'priority' => '30', // 'description' => __( 'Example section description.', 'smtm' ) // ); // // $options['upload'] = array( // 'id' => 'upload', // 'label' => __( 'upload', 'smtm' ), // 'section' => $section, // 'type' => 'upload', // 'default' => '', // ); // // Colors // $section = 'colors'; // // $sections[] = array( // 'id' => $section, // 'title' => __( 'Colors', 'smtm' ), // 'priority' => '80' // ); // // $options['primary-color'] = array( // 'id' => 'primary-color', // 'label' => __( 'Primary Color', 'smtm' ), // 'section' => $section, // 'type' => 'color', // 'default' => $primary_color, // ); // // $options['secondary-color'] = array( // 'id' => 'secondary-color', // 'label' => __( 'Secondary Color', 'smtm' ), // 'section' => $section, // 'type' => 'color', // 'default' => $secondary_color, // ); // // $options['border'] = array( // 'id' => 'border', // 'label' => __( 'Border Color', 'smtm' ), // 'section' => $section, // 'type' => 'color', // 'default' => $primary_color, // ); // Typography $section = 'typography'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Typography', 'smtm'), 'priority' => '80'); $options['primary-font'] = array('id' => 'primary-font', 'label' => __('Primary Font', 'smtm'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Varela'); $options['secondary-font'] = array('id' => 'secondary-font', 'label' => __('Secondary Font', 'smtm'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Varela'); $options['tertiary-font'] = array('id' => 'tertiary-font', 'label' => __('tertiary Font', 'smtm'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Varela'); //Site colors $section = 'site-colors'; $sections[] = array('id' => $section, 'title' => __('Site Colors', 'smtm'), 'priority' => '80'); $options['primary-color'] = array('id' => 'primary-color', 'label' => __('Primary Color', 'smtm'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['secondary-color'] = array('id' => 'secondary-color', 'label' => __('Secondary Color', 'smtm'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); $options['header-color'] = array('id' => 'header-color', 'label' => __('Header background Color', 'smtm'), 'section' => $section, 'type' => 'color', 'default' => $header_color); $options['footer-color'] = array('id' => 'footer-color', 'label' => __('Footer background Color', 'smtm'), 'section' => $section, 'type' => 'color', 'default' => $footer_color); $options['background-color'] = array('id' => 'background-color', 'label' => __('Background Color', 'smtm'), 'section' => $section, 'type' => 'color', 'default' => $background_color); // // More Examples // $section = 'examples'; // // $sections[] = array( // 'id' => $section, // 'title' => __( 'More Examples', 'smtm' ), // 'priority' => '90' // ); // // $options['example-text'] = array( // 'id' => 'example-text', // 'label' => __( 'Example Text Input', 'smtm' ), // 'section' => $section, // 'type' => 'text', // ); // // $options['example-url'] = array( // 'id' => 'example-url', // 'label' => __( 'Example URL Input', 'smtm' ), // 'section' => $section, // 'type' => 'url', // ); // // $options['example-checkbox'] = array( // 'id' => 'example-checkbox', // 'label' => __( 'Example Checkbox', 'smtm' ), // 'section' => $section, // 'type' => 'checkbox', // 'default' => 0, // ); // // $choices = array( // 'choice-1' => 'Choice One', // 'choice-2' => 'Choice Two', // 'choice-3' => 'Choice Three' // ); // // $options['example-select'] = array( // 'id' => 'example-select', // 'label' => __( 'Example Select', 'smtm' ), // 'section' => $section, // 'type' => 'select', // 'choices' => $choices, // 'default' => 'choice-1' // ); // // $options['example-radio'] = array( // 'id' => 'example-radio', // 'label' => __( 'Example Radio', 'smtm' ), // 'section' => $section, // 'type' => 'radio', // 'choices' => $choices, // 'default' => 'choice-1' // ); // // $options['example-textarea'] = array( // 'id' => 'example-textarea', // 'label' => __( 'Example Textarea', 'smtm' ), // 'section' => $section, // 'type' => 'textarea', // 'default' => __( 'Example textarea text.', 'smtm'), // ); // // $options['example-range'] = array( // 'id' => 'example-range', // 'label' => __( 'Example Range Input', 'smtm' ), // 'section' => $section, // 'type' => 'range', // 'input_attrs' => array( // 'min' => 0, // 'max' => 10, // 'step' => 1, // 'style' => 'color: #0a0', // ) // ); // // // Panel Example // $panel = 'panel'; // // $panels[] = array( // 'id' => $panel, // 'title' => __( 'Panel Examples', 'smtm' ), // 'priority' => '100' // ); // // $section = 'panel-section'; // // $sections[] = array( // 'id' => $section, // 'title' => __( 'Panel Section', 'smtm' ), // 'priority' => '10', // 'panel' => $panel // ); // // $options['example-panel-text'] = array( // 'id' => 'example-panel-text', // 'label' => __( 'Example Text Input', 'smtm' ), // 'section' => $section, // 'type' => 'text', // ); // // Adds the sections to the $options array $options['sections'] = $sections; // Adds the panels to the $options array $options['panels'] = $panels; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
//TEXT COLOR ON BASE COLOR $wp_customize->add_setting('optimizer[sectxt_color_id]', array('type' => 'option', 'default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'sectxt_color_id', array('label' => __('Other Elements Text Color', 'optimizer'), 'description' => __('Affects Front page post hover text color, Search button text color.', 'optimizer'), 'section' => 'general_color_section', 'settings' => 'optimizer[sectxt_color_id]'))); //---------TYPOGRAPHY SETTINGS--------------------- // Site Content Font Family $wp_customize->add_setting('optimizer[content_font_id][font-family]', array('type' => 'option', 'default' => 'Open Sans', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_attr')); $wp_customize->add_control('content_font_family', array('type' => 'select', 'label' => __('Family', 'optimizer'), 'section' => 'basic_typography', 'settings' => 'optimizer[content_font_id][font-family]', 'choices' => customizer_library_get_font_choices())); // Site Content Font Subsets $wp_customize->add_setting('optimizer[content_font_id][subsets]', array('type' => 'option', 'default' => 'latin', 'sanitize_callback' => 'esc_attr', 'transport' => 'postMessage')); $wp_customize->add_control('content_font_subsets', array('type' => 'select', 'label' => __('Subsets', 'optimizer'), 'section' => 'basic_typography', 'settings' => 'optimizer[content_font_id][subsets]', 'choices' => customizer_library_get_google_font_subsets())); //Site Content Font Size $wp_customize->add_setting('optimizer[content_font_id][font-size]', array('type' => 'option', 'default' => '16px', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage')); $wp_customize->add_control('content_font_size', array('type' => 'text', 'label' => __('Font Size', 'optimizer'), 'section' => 'basic_typography', 'settings' => 'optimizer[content_font_id][font-size]', 'input_attrs' => array('class' => 'mini_control'))); // Post Titles, headings and Menu Font Family $wp_customize->add_setting('optimizer[ptitle_font_id][font-family]', array('type' => 'option', 'default' => 'Open Sans', 'sanitize_callback' => 'esc_attr', 'transport' => 'postMessage')); $wp_customize->add_control('ptitle_font_family', array('type' => 'select', 'label' => __('Family', 'optimizer'), 'section' => 'basic_typography', 'settings' => 'optimizer[ptitle_font_id][font-family]', 'choices' => customizer_library_get_font_choices())); // Post Titles, headings and Menu Font Subsets $wp_customize->add_setting('optimizer[ptitle_font_id][subsets]', array('type' => 'option', 'default' => 'latin', 'sanitize_callback' => 'esc_attr', 'transport' => 'postMessage')); $wp_customize->add_control('ptitle_font_subsets', array('type' => 'select', 'label' => __('Subsets', 'optimizer'), 'section' => 'basic_typography', 'settings' => 'optimizer[ptitle_font_id][subsets]', 'choices' => customizer_library_get_google_font_subsets())); //Turn Menu Text & All Headings to Uppercase $wp_customize->add_setting('optimizer[txt_upcase_id]', array('type' => 'option', 'default' => '1', 'sanitize_callback' => 'optimizer_sanitize_checkbox', 'transport' => 'postMessage')); $wp_customize->add_control(new Optimizer_Controls_Toggle_Control($wp_customize, 'txt_upcase_id', array('label' => __('Turn Menu Text & All Headings to Uppercase', 'optimizer'), 'section' => 'basic_typography', 'settings' => 'optimizer[txt_upcase_id]'))); //---------------LAYOUT CALLBACK-------------------// function optimizer_layout_callback($control) { $layout_setting = $control->manager->get_setting('optimizer[site_layout_id]')->value(); if ($layout_setting == 'site_boxed') { return true; } return false; }
/** * Defines customizer options * * @package Customizer Library Demo */ function customizer_library_oceanic_options() { // Theme defaults $primary_color = '#01B6AD'; $secondary_color = '#019289'; $body_font_color = '#4F4F4F'; $heading_font_color = '#5E5E5E'; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Adds the sections to the $options array $options['sections'] = $sections; // Favicon $section = 'oceanic-favicon'; $sections[] = array('id' => $section, 'title' => __('Favicon', 'oceanic'), 'priority' => '10'); $options['oceanic-favicon'] = array('id' => 'oceanic-favicon', 'label' => __('Favicon', 'oceanic'), 'section' => $section, 'type' => 'image', 'default' => ''); // Layout Settings $section = 'oceanic-layout'; $sections[] = array('id' => $section, 'title' => __('Layout', 'oceanic'), 'priority' => '30'); // Upsell Button One $options['oceanic-upsell-one'] = array('id' => 'oceanic-upsell-one', 'label' => __('Site Layout', 'oceanic'), 'section' => $section, 'type' => 'upsell'); // Header Settings $section = 'oceanic-header'; $sections[] = array('id' => $section, 'title' => __('Header', 'oceanic'), 'priority' => '35'); $choices = array('oceanic-header-layout-standard' => 'Standard', 'oceanic-header-layout-centered' => 'Centered'); $options['oceanic-header-layout'] = array('id' => 'oceanic-header-layout', 'label' => __('Layout', 'oceanic'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'oceanic-header-layout-standard'); // Upsell Button Two $options['oceanic-upsell-two'] = array('id' => 'oceanic-upsell-two', 'label' => __('Sticky Header', 'oceanic'), 'section' => $section, 'type' => 'upsell'); $options['oceanic-header-info-text'] = array('id' => 'oceanic-header-info-text', 'label' => __('Info Text', 'oceanic'), 'section' => $section, 'type' => 'text', 'default' => __('<em>CALL US</em>: 555-OCEANIC', 'oceanic')); $options['oceanic-header-shop-links'] = array('id' => 'oceanic-header-shop-links', 'label' => __('Shop Links', 'oceanic'), 'section' => $section, 'type' => 'checkbox', 'default' => 1, 'description' => __('Display the My Account and Checkout links when WooCommerce is active.', 'oceanic')); // Slider Settings $section = 'oceanic-slider'; $sections[] = array('id' => $section, 'title' => __('Slider', 'oceanic'), 'priority' => '35'); $choices = array('oceanic-slider-default' => 'Default Slider', 'oceanic-meta-slider' => 'Meta Slider', 'oceanic-no-slider' => 'None'); $options['oceanic-slider-type'] = array('id' => 'oceanic-slider-type', 'label' => __('Choose a Slider', 'oceanic'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'oceanic-slider-default'); $options['oceanic-slider-cats'] = array('id' => 'oceanic-slider-cats', 'label' => __('Slider Categories', 'oceanic'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the names of the Post categories you want to display in the slider e.g. "Slider". Multiple categories must be separated with a comma.', 'oceanic')); $options['oceanic-slider-transition-speed'] = array('id' => 'oceanic-slider-transition-speed', 'label' => __('Slide Transition Speed', 'oceanic'), 'section' => $section, 'type' => 'text', 'default' => 450, 'description' => __('The speed it takes to transition between slides in milliseconds. 1000 milliseconds equals 1 second.', 'oceanic')); // Upsell Button Six $options['oceanic-upsell-six'] = array('id' => 'oceanic-upsell-six', 'label' => __('Slideshow', 'oceanic'), 'section' => $section, 'type' => 'upsell'); // Upsell Button Seven $options['oceanic-upsell-seven'] = array('id' => 'oceanic-upsell-seven', 'label' => __('Slideshow Speed', 'oceanic'), 'section' => $section, 'type' => 'upsell'); $options['oceanic-meta-slider-shortcode'] = array('id' => 'oceanic-meta-slider-shortcode', 'label' => __('Meta Slider Shortcode', 'oceanic'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the shortcode given by Meta Slider.', 'oceanic')); // Styling $section = 'oceanic-styling'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Styling', 'oceanic'), 'priority' => '38'); $options['oceanic-main-color'] = array('id' => 'oceanic-main-color', 'label' => __('Primary Color', 'oceanic'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['oceanic-main-color-hover'] = array('id' => 'oceanic-main-color-hover', 'label' => __('Secondary Color', 'oceanic'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); $options['oceanic-body-font'] = array('id' => 'oceanic-body-font', 'label' => __('Body Font', 'oceanic'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Open Sans'); $options['oceanic-body-font-color'] = array('id' => 'oceanic-body-font-color', 'label' => __('Body Font Color', 'oceanic'), 'section' => $section, 'type' => 'color', 'default' => $body_font_color); $options['oceanic-heading-font'] = array('id' => 'oceanic-heading-font', 'label' => __('Heading Font', 'oceanic'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Raleway'); $options['oceanic-heading-font-color'] = array('id' => 'oceanic-heading-font-color', 'label' => __('Heading Font Color', 'oceanic'), 'section' => $section, 'type' => 'color', 'default' => $heading_font_color); // Blog Settings $section = 'oceanic-blog'; $sections[] = array('id' => $section, 'title' => __('Blog', 'oceanic'), 'priority' => '50'); // Upsell Button Three $options['oceanic-upsell-three'] = array('id' => 'oceanic-upsell-three', 'label' => __('Blog Post Layout', 'oceanic'), 'section' => $section, 'type' => 'upsell'); $options['oceanic-blog-title'] = array('id' => 'oceanic-blog-title', 'label' => __('Blog Page Title', 'oceanic'), 'section' => $section, 'type' => 'text', 'default' => 'Blog'); // Upsell Button Eight $options['oceanic-upsell-eight'] = array('id' => 'oceanic-upsell-eight', 'label' => __('Single Blog Post Featured Image', 'oceanic'), 'section' => $section, 'type' => 'upsell'); // Social Settings $section = 'oceanic-social'; $sections[] = array('id' => $section, 'title' => __('Social Links', 'oceanic'), 'priority' => '80'); // Upsell Button Four $options['oceanic-upsell-four'] = array('id' => 'oceanic-upsell-four', 'label' => __('Social Links', 'oceanic'), 'section' => $section, 'type' => 'upsell'); // Site Text Settings $section = 'oceanic-website'; $sections[] = array('id' => $section, 'title' => __('Website Text', 'oceanic'), 'priority' => '50'); $options['oceanic-website-error-head'] = array('id' => 'oceanic-website-error-head', 'label' => __('404 Page Heading', 'oceanic'), 'section' => $section, 'type' => 'text', 'default' => __('Oops! <span>404</span>', 'oceanic'), 'description' => __('Enter the heading for the 404 error page', 'oceanic')); $options['oceanic-website-error-msg'] = array('id' => 'oceanic-website-error-msg', 'label' => __('404 Page Message', 'oceanic'), 'section' => $section, 'type' => 'textarea', 'default' => __('It looks like that page does not exist. <br />Return home or try a search', 'oceanic'), 'description' => __('Enter the default text for the 404 error page (Page not found)', 'oceanic')); $options['oceanic-website-nosearch-msg'] = array('id' => 'oceanic-website-nosearch-msg', 'label' => __('No Search Results', 'oceanic'), 'section' => $section, 'type' => 'textarea', 'default' => __('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'oceanic'), 'description' => __('Enter the default text for when no search results are found', 'oceanic')); // Footer Settings $section = 'oceanic-footer'; $sections[] = array('id' => $section, 'title' => __('Footer', 'oceanic'), 'priority' => '50'); // Upsell Button Five $options['oceanic-upsell-five'] = array('id' => 'oceanic-upsell-five', 'label' => __('Copyright Text', 'oceanic'), 'section' => $section, 'type' => 'upsell'); // Adds the sections to the $options array $options['sections'] = $sections; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
/** * Defines customizer options * * @package Customizer Library myStore */ function customizer_library_mystore_options() { // Theme defaults $header_bg_color = '#EEEEEE'; $primary_color = '#29a6e5'; $secondary_color = '#2886e5'; $body_font_color = '#404040'; $heading_font_color = '#5E5E5E'; $site_border_color = '#666'; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Stores all the panels to be added $panels = array(); // Adds the sections to the $options array $options['sections'] = $sections; // Favicon $section = 'mystore-favicon-section'; $sections[] = array('id' => $section, 'title' => __('Favicon', 'mystore'), 'priority' => '30', 'description' => __('', 'mystore')); $options['mystore-favicon'] = array('id' => 'mystore-favicon', 'label' => __('Uplod a favicon', 'mystore'), 'section' => $section, 'type' => 'image', 'description' => __('Favicon size is 16 X 16 pixels.', 'mystore'), 'default' => ''); // Site Layout Options $section = 'mystore-site-layout-section'; $sections[] = array('id' => $section, 'title' => __('Layout Options', 'mystore'), 'priority' => '30', 'description' => __('', 'mystore')); // Upsell Button One $options['mystore-setting-upsell-one'] = array('id' => 'mystore-setting-upsell-one', 'label' => __('Page Styling - Flat / Blocks', 'mystore'), 'section' => $section, 'type' => 'upsell'); $options['mystore-site-remove-border'] = array('id' => 'mystore-site-remove-border', 'label' => __('Remove the Site Border', 'mystore'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); // Upsell Button Two $options['mystore-setting-upsell-two'] = array('id' => 'mystore-setting-upsell-two', 'label' => __('Extra WooCommerce Layout', 'mystore'), 'section' => $section, 'type' => 'upsell'); // Header Layout Options $section = 'mystore-header-section'; $sections[] = array('id' => $section, 'title' => __('Header Options', 'mystore'), 'priority' => '30', 'description' => __('', 'mystore')); $choices = array('mystore-header-layout-centered' => 'Centered Layout Style', 'mystore-header-layout-standard' => 'Standard Layout Style'); $options['mystore-header-layout'] = array('id' => 'mystore-header-layout', 'label' => __('Header Layout', 'mystore'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'mystore-header-layout-centered'); $options['mystore-header-bg-color'] = array('id' => 'mystore-header-bg-color', 'label' => __('Header Background Color', 'mystore'), 'section' => $section, 'type' => 'color', 'default' => $header_bg_color); $options['mystore-header-remove-topbar'] = array('id' => 'mystore-header-remove-topbar', 'label' => __('Remove the Top Bar', 'mystore'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); $options['mystore-header-menu-text'] = array('id' => 'mystore-header-menu-text', 'label' => __('Menu Button Text', 'mystore'), 'section' => $section, 'type' => 'text', 'default' => 'menu', 'description' => __('This is the text for the menu button', 'mystore')); $options['mystore-header-search'] = array('id' => 'mystore-header-search', 'label' => __('Show Search', 'mystore'), 'section' => $section, 'type' => 'checkbox', 'description' => __('Enable a search box on your site', 'mystore'), 'default' => 0); // Slider Settings $section = 'mystore-slider-section'; $sections[] = array('id' => $section, 'title' => __('Slider Options', 'mystore'), 'priority' => '35'); $choices = array('mystore-slider-default' => 'Default Slider', 'mystore-meta-slider' => 'Meta Slider', 'mystore-no-slider' => 'None'); $options['mystore-slider-type'] = array('id' => 'mystore-slider-type', 'label' => __('Choose a Slider', 'mystore'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'mystore-slider-default'); $options['mystore-slider-cats'] = array('id' => 'mystore-slider-cats', 'label' => __('Slider Categories', 'mystore'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the ID\'s of the post categories you want to display in the slider. Eg: "13,17,19" (no spaces and only comma\'s)<br /><a href="http://kairaweb.com/support/topic/setting-up-the-default-slider/" target="_blank"><b>Follow instructions here</b></a>', 'mystore')); $options['mystore-meta-slider-shortcode'] = array('id' => 'mystore-meta-slider-shortcode', 'label' => __('Slider Shortcode', 'mystore'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the shortcode give by meta slider.', 'mystore')); // Upsell Button Three $options['mystore-setting-upsell-three'] = array('id' => 'mystore-setting-upsell-three', 'label' => __('Extra Slider Settings', 'mystore'), 'section' => $section, 'type' => 'upsell'); // Colors $section = 'colors'; $sections[] = array('id' => $section, 'title' => __('Colors', 'mystore'), 'priority' => '80'); $options['mystore-primary-color'] = array('id' => 'mystore-primary-color', 'label' => __('Primary Color', 'mystore'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['mystore-secondary-color'] = array('id' => 'mystore-secondary-color', 'label' => __('Secondary Color', 'mystore'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); $options['mystore-site-border'] = array('id' => 'mystore-site-border', 'label' => __('Site Border Color', 'mystore'), 'section' => $section, 'type' => 'color', 'default' => $site_border_color); // Font Options $section = 'mystore-typography-section'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Font Options', 'mystore'), 'priority' => '80'); $options['mystore-body-font'] = array('id' => 'mystore-body-font', 'label' => __('Body Font', 'mystore'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Open Sans'); $options['mystore-body-font-color'] = array('id' => 'mystore-body-font-color', 'label' => __('Body Font Color', 'mystore'), 'section' => $section, 'type' => 'color', 'default' => $body_font_color); $options['mystore-heading-font'] = array('id' => 'mystore-heading-font', 'label' => __('Heading Font', 'mystore'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Droid Serif'); $options['mystore-heading-font-color'] = array('id' => 'mystore-heading-font-color', 'label' => __('Heading Font Color', 'mystore'), 'section' => $section, 'type' => 'color', 'default' => $heading_font_color); // Blog Settings $section = 'mystore-blog-section'; $sections[] = array('id' => $section, 'title' => __('Blog Options', 'mystore'), 'priority' => '50'); // Upsell Button Four $options['mystore-setting-upsell-four'] = array('id' => 'mystore-setting-upsell-four', 'label' => __('Blog Layout & full width option', 'mystore'), 'section' => $section, 'type' => 'upsell'); $options['mystore-blog-title'] = array('id' => 'mystore-blog-title', 'label' => __('Blog Page Title', 'mystore'), 'section' => $section, 'type' => 'text', 'default' => 'Blog'); $options['mystore-blog-cats'] = array('id' => 'mystore-blog-cats', 'label' => __('Exclude Blog Categories', 'mystore'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the ID\'s of the post categories you\'d like to EXCLUDE from the Blog, enter only the ID\'s with a minus sign (-) before them, separated by a comma (,)<br />Eg: "-13, -17, -19"<br />If you enter the ID\'s without the minus then it\'ll show ONLY posts in those categories.', 'mystore')); // Footer Settings $section = 'mystore-footer-section'; $sections[] = array('id' => $section, 'title' => __('Footer Layout Options', 'mystore'), 'priority' => '85'); // Upsell Button Five $options['mystore-setting-upsell-five'] = array('id' => 'mystore-setting-upsell-five', 'label' => __('Different Footer Layouts & remove bottom bar', 'mystore'), 'section' => $section, 'type' => 'upsell'); // Site Text Settings $section = 'mystore-website-section'; $sections[] = array('id' => $section, 'title' => __('Website Text', 'mystore'), 'priority' => '50'); // Upsell Button Six $options['mystore-setting-upsell-six'] = array('id' => 'mystore-setting-upsell-six', 'label' => __('Change CopyRight Text', 'mystore'), 'section' => $section, 'type' => 'upsell'); $options['mystore-website-error-head'] = array('id' => 'mystore-website-error-head', 'label' => __('404 Error Page Heading', 'mystore'), 'section' => $section, 'type' => 'text', 'default' => __('Oops! <span>404</span>', 'mystore'), 'description' => __('Enter the heading for the 404 Error page', 'mystore')); $options['mystore-website-error-msg'] = array('id' => 'mystore-website-error-msg', 'label' => __('Error 404 Message', 'mystore'), 'section' => $section, 'type' => 'textarea', 'default' => __('It looks like that page does not exist. <br />Return home or try a search', 'mystore'), 'description' => __('Enter the default text on the 404 error page (Page not found)', 'mystore')); $options['mystore-website-nosearch-msg'] = array('id' => 'mystore-website-nosearch-msg', 'label' => __('No Search Results', 'mystore'), 'section' => $section, 'type' => 'textarea', 'default' => __('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'mystore'), 'description' => __('Enter the default text for when no search results are found', 'mystore')); // Social Settings $section = 'mystore-social-section'; $sections[] = array('id' => $section, 'title' => __('Social Links', 'mystore'), 'priority' => '80'); // Upsell Button Seven $options['mystore-setting-upsell-seven'] = array('id' => 'mystore-setting-upsell-seven', 'label' => __('Add Social Links', 'mystore'), 'section' => $section, 'type' => 'upsell'); // Adds the sections to the $options array $options['sections'] = $sections; // Adds the panels to the $options array $options['panels'] = $panels; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
/** * Gather Options * * @since 1.0.0 * * @return array $options */ function gather_options() { // Theme defaults $primary_color = '#5bc08c'; $secondary_color = '#f99868'; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Header section $section = 'title_tagline'; $options['logo'] = array('id' => 'logo', 'label' => __('Logo', 'gather'), 'section' => $section, 'type' => 'upload', 'default' => '', 'priority' => 10); $options['center-branding'] = array('id' => 'center-branding', 'label' => __('Center Header Text/Logo', 'gather'), 'section' => $section, 'type' => 'checkbox', 'default' => 0, 'priority' => 20); $options['header-background-color'] = array('id' => 'header-background-color', 'label' => __('Header Background Color', 'gather'), 'section' => $section, 'type' => 'color', 'default' => '#ffffff', 'priority' => 30); $options['header-background-image'] = array('id' => 'header-background-image', 'label' => __('Header Background Image', 'gather'), 'section' => $section, 'type' => 'upload', 'default' => '', 'priority' => 40); $choices = array('image-scale' => 'Image Scale', 'image-repeat' => 'Image Repeat'); $options['header-background-image-style'] = array('id' => 'header-background-image-style', 'label' => __('Background Image Style', 'gather'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'image-scale', 'priority' => 50); // Navigation Styles $section = 'navigation-styles'; $sections[] = array('id' => $section, 'title' => __('Navigation Styles', 'gather'), 'priority' => '30'); $menus = array('primary', 'secondary'); foreach ($menus as $menu) { if (!has_nav_menu($menu)) { break; } if ($menu == 'primary') { $label = __('Primary Menu'); } if ($menu == 'secondary') { $label = __('Secondary Menu'); } $options[$menu . '-menu-background'] = array('id' => $menu . '-menu-background', 'label' => __(sprintf('Background (%s)', $label), 'gather'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $mod = get_theme_mod($menu . '-menu-background', $primary_color); $color = sanitize_hex_color($mod); // 5% lighter $color_obj = new Jetpack_Color($color); $lighten5 = $color_obj->lighten(5)->toHex(); // 20% lighter $color_obj = new Jetpack_Color($color); $lighten20 = $color_obj->lighten(20)->toHex(); // Contrasting text $color_obj = new Jetpack_Color($color); $contrast = $color_obj->getGrayscaleContrastingColor()->lighten(40)->toHex(); $options[$menu . '-menu-background-hover'] = array('id' => $menu . '-menu-background-hover', 'label' => __(sprintf('Background Hover (%s)', $label), 'gather'), 'section' => $section, 'type' => 'color', 'default' => $lighten5); $options[$menu . '-menu-color'] = array('id' => $menu . '-menu-color', 'label' => __(sprintf('Text (%s)', $label), 'gather'), 'section' => $section, 'type' => 'color', 'default' => $contrast); $options[$menu . '-menu-border'] = array('id' => $menu . '-menu-border', 'label' => __(sprintf('Border (%s)', $label), 'gather'), 'section' => $section, 'type' => 'color', 'default' => $lighten20); $options[$menu . '-menu-search'] = array('id' => $menu . '-menu-search', 'label' => __(sprintf('Search Box (%s)', $label), 'gather'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); } // Colors $section = 'colors'; $sections[] = array('id' => $section, 'title' => __('Colors', 'gather'), 'priority' => '80'); $options['primary-color'] = array('id' => 'primary-color', 'label' => __('Primary Color', 'gather'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['secondary-color'] = array('id' => 'secondary-color', 'label' => __('Secondary Color', 'gather'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); $options['site-title-color'] = array('id' => 'site-title-color', 'label' => __('Site Title Color', 'gather'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['site-title-hover-color'] = array('id' => 'site-title-hover-color', 'label' => __('Site Title Hover Color', 'gather'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); $options['site-tagline-color'] = array('id' => 'site-tagline-color', 'label' => __('Site Tagline Color', 'gather'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); // Layout $section = 'layout'; $sections[] = array('id' => $section, 'title' => __('Layout', 'gather'), 'priority' => '70'); $choices = array('sidebar-right' => 'Sidebar Right', 'sidebar-left' => 'Sidebar Left'); $options['standard-layout'] = array('id' => 'standard-layout', 'label' => __('Standard Layout', 'gather'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'sidebar-right'); $choices = array('standard' => 'Standard Layout', 'column-masonry-2' => '2 Column Masonry', 'column-masonry-3' => '3 Column Masonry', 'column-masonry-4' => '4 Column Masonry'); $options['archive-layout'] = array('id' => 'archive-layout', 'label' => __('Archive Layout', 'gather'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'column-masonry-3'); $options['archive-sidebar'] = array('id' => 'archive-sidebar', 'label' => __('Display Sidebar on Archives', 'gather'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); // Typography $section = 'typography'; $sections[] = array('id' => $section, 'title' => __('Typography', 'gather'), 'priority' => '75'); $options['site-title-font'] = array('id' => 'site-title-font', 'label' => __('Site Title Font', 'gather'), 'section' => $section, 'type' => 'select', 'choices' => customizer_library_get_font_choices(), 'default' => 'Monoton'); $options['primary-font'] = array('id' => 'primary-font', 'label' => __('Primary Font', 'gather'), 'section' => $section, 'type' => 'select', 'choices' => customizer_library_get_font_choices(), 'default' => 'Roboto'); $options['secondary-font'] = array('id' => 'secondary-font', 'label' => __('Secondary Font', 'gather'), 'section' => $section, 'type' => 'select', 'choices' => customizer_library_get_font_choices(), 'default' => 'Merriweather'); // Archive Settings $section = 'archive'; $sections[] = array('id' => $section, 'title' => __('Archive', 'gather'), 'priority' => '80'); $options['archive-excerpts'] = array('id' => 'archive-excerpts', 'label' => __('Display Excerpts', 'gather'), 'description' => __('Display excerpts instead of full content.', 'gather'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); $options['archive-featured-images'] = array('id' => 'archive-featured-images', 'label' => __('Display Featured Images', 'gather'), 'section' => $section, 'type' => 'checkbox', 'default' => 1); // Post Settings $section = 'post'; $sections[] = array('id' => $section, 'title' => __('Post', 'gather'), 'priority' => '80'); $options['display-post-dates'] = array('id' => 'display-post-dates', 'label' => __('Display Post Dates', 'gather'), 'section' => $section, 'type' => 'checkbox', 'default' => 1); $options['post-featured-images'] = array('id' => 'post-featured-images', 'label' => __('Display Featured Images', 'gather'), 'section' => $section, 'type' => 'checkbox', 'default' => 1); // Footer Settings $section = 'footer'; $sections[] = array('id' => $section, 'title' => __('Footer', 'gather'), 'priority' => '100'); $options['footer-text'] = array('id' => 'footer-text', 'label' => __('Footer Text', 'gather'), 'section' => $section, 'type' => 'textarea', 'default' => gather_get_default_footer_text()); // Adds the sections to the $options array $options['sections'] = $sections; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); }
/** * Defines customizer options * * @package Customizer Library Demo */ function customizer_library_xcel_options() { // Theme defaults $primary_color = '#0c3768'; $secondary_color = '#0d4a87'; $title_color = '#2B598E'; $title_font_color = '#FFFFFF'; $body_font_color = '#4F4F4F'; $heading_font_color = '#5E5E5E'; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Adds the sections to the $options array $options['sections'] = $sections; // Layout Settings $section = 'xcel-setting-layout'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Site Options', 'xcel'), 'priority' => '30'); // Upsell Button One $options['xcel-setting-upsell-one'] = array('id' => 'xcel-setting-upsell-one', 'label' => __('Full Width / Boxed Layout', 'xcel'), 'section' => $section, 'type' => 'upsell'); $options['xcel-setting-main-color'] = array('id' => 'xcel-setting-main-color', 'label' => __('Main Color', 'xcel'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['xcel-setting-main-color-hover'] = array('id' => 'xcel-setting-main-color-hover', 'label' => __('Secondary Color', 'xcel'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); $options['xcel-setting-body-font'] = array('id' => 'xcel-setting-body-font', 'label' => __('Body Font', 'xcel'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Open Sans'); $options['xcel-setting-body-font-color'] = array('id' => 'xcel-setting-body-font-color', 'label' => __('Body Font Color', 'xcel'), 'section' => $section, 'type' => 'color', 'default' => $body_font_color); $options['xcel-setting-heading-font'] = array('id' => 'xcel-setting-heading-font', 'label' => __('Headings Font', 'xcel'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Raleway'); $options['xcel-setting-heading-font-color'] = array('id' => 'xcel-setting-heading-font-color', 'label' => __('Heading Font Color', 'xcel'), 'section' => $section, 'type' => 'color', 'default' => $heading_font_color); // Header Settings $section = 'xcel-setting-header'; $sections[] = array('id' => $section, 'title' => __('Header Options', 'xcel'), 'priority' => '30'); // Upsell Button Two $options['xcel-setting-upsell-two'] = array('id' => 'xcel-setting-upsell-two', 'label' => __('Header Standard / Right Layout', 'xcel'), 'section' => $section, 'type' => 'upsell'); $options['xcel-setting-header-search'] = array('id' => 'xcel-setting-header-search', 'label' => __('Show Search', 'xcel'), 'section' => $section, 'type' => 'checkbox', 'description' => __('Enable a search box on your site', 'xcel'), 'default' => 0); // Upsell Button Two-one $options['xcel-setting-upsell-two-one'] = array('id' => 'xcel-setting-upsell-two-one', 'label' => __('Header Color', 'xcel'), 'section' => $section, 'type' => 'upsell'); // Title Settings $section = 'xcel-setting-title'; $sections[] = array('id' => $section, 'title' => __('Page Title Options', 'xcel'), 'priority' => '30'); // Upsell Button Three $options['xcel-setting-upsell-three'] = array('id' => 'xcel-setting-upsell-three', 'label' => __('Extra Title Bar Settings', 'xcel'), 'section' => $section, 'type' => 'upsell'); $options['xcel-setting-title-color'] = array('id' => 'xcel-setting-title-color', 'label' => __('Title Bar Color', 'xcel'), 'section' => $section, 'type' => 'color', 'default' => $title_color); $options['xcel-setting-title-font-color'] = array('id' => 'xcel-setting-title-font-color', 'label' => __('Title Bar Font Color', 'xcel'), 'section' => $section, 'type' => 'color', 'default' => $title_font_color); $choices = array('xcel-setting-title-bgimg-top' => 'Align Top', 'xcel-setting-title-bgimg-middle' => 'Align Centered', 'xcel-setting-title-bgimg-bottom' => 'Align Bottom'); $options['xcel-setting-title-bgimg'] = array('id' => 'xcel-setting-title-bgimg', 'label' => __('Background Image Position', 'xcel'), 'section' => $section, 'type' => 'select', 'description' => __('To set the image for the post/page you need to set a "Featured Image" on each post/page.', 'xcel'), 'choices' => $choices, 'default' => 'xcel-setting-title-bgimg-middle'); // Slider Settings $section = 'xcel-setting-slider'; $sections[] = array('id' => $section, 'title' => __('Slider Options', 'xcel'), 'priority' => '35'); $choices = array('xcel-setting-slider-default' => 'Default Slider', 'xcel-setting-meta-slider' => 'Meta Slider', 'xcel-setting-no-slider' => 'None'); $options['xcel-setting-slider-type'] = array('id' => 'xcel-setting-slider-type', 'label' => __('Choose a Slider', 'xcel'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'xcel-setting-slider-default'); $options['xcel-setting-slider-cats'] = array('id' => 'xcel-setting-slider-cats', 'label' => __('Slider Categories', 'xcel'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the ID\'s of the post categories you want to display in the slider. Eg: "13,17,19" (no spaces and only comma\'s)<br /><a href="http://kairaweb.com/support/topic/setting-up-the-default-slider/" target="_blank"><b>Follow instructions here</b></a>', 'xcel')); $choices = array('xcel-setting-slider-size-small' => 'Small Slider', 'xcel-setting-slider-size-medium' => 'Medium Slider', 'xcel-setting-slider-size-large' => 'Large Slider'); // Upsell Button Four $options['xcel-setting-upsell-four'] = array('id' => 'xcel-setting-upsell-four', 'label' => __('Extra Slider Settings', 'xcel'), 'section' => $section, 'type' => 'upsell'); $options['xcel-setting-meta-slider-shortcode'] = array('id' => 'xcel-setting-meta-slider-shortcode', 'label' => __('Slider Shortcode', 'xcel'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the shortcode give by meta slider.', 'xcel')); // Blog Settings $section = 'xcel-setting-blog'; $sections[] = array('id' => $section, 'title' => __('Blog Options', 'xcel'), 'priority' => '50'); $options['xcel-setting-blog-title'] = array('id' => 'xcel-setting-blog-title', 'label' => __('Blog Page Title', 'xcel'), 'section' => $section, 'type' => 'text', 'default' => 'Blog'); $options['xcel-setting-blog-cats'] = array('id' => 'xcel-setting-blog-cats', 'label' => __('Exclude Blog Categories', 'xcel'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the ID\'s of the post categories you\'d like to EXCLUDE from the Blog, enter only the ID\'s with a minus sign (-) before them, separated by a comma (,)<br />Eg: "-13, -17, -19"<br />If you enter the ID\'s without the minus then it\'ll show ONLY posts in those categories.', 'xcel')); // Upsell Button Five $options['xcel-setting-upsell-five'] = array('id' => 'xcel-setting-upsell-five', 'label' => __('Extra Blog Settings', 'xcel'), 'section' => $section, 'type' => 'upsell'); // Layout Settings $section = 'xcel-setting-footer'; $sections[] = array('id' => $section, 'title' => __('Footer Layout Options', 'xcel'), 'priority' => '85'); // Upsell Button Six $options['xcel-setting-upsell-six'] = array('id' => 'xcel-setting-upsell-six', 'label' => __('Select from 5 footer layouts', 'xcel'), 'section' => $section, 'type' => 'upsell'); $choices = array('xcel-setting-footer-layout-standard' => 'Standard Layout', 'xcel-setting-footer-layout-none' => 'None'); $options['xcel-setting-footer-layout'] = array('id' => 'xcel-setting-footer-layout', 'label' => __('Footer Layout', 'xcel'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'xcel-setting-footer-layout-standard'); // Upsell Button Seven $options['xcel-setting-upsell-seven'] = array('id' => 'xcel-setting-upsell-seven', 'label' => __('Remove Footer Bottom Bar', 'xcel'), 'section' => $section, 'type' => 'upsell'); // Social Settings $section = 'xcel-setting-social'; $sections[] = array('id' => $section, 'title' => __('Social Links', 'xcel'), 'priority' => '80'); // Upsell Button Eight $options['xcel-setting-upsell-eight'] = array('id' => 'xcel-setting-upsell-eight', 'label' => __('Add Social Links', 'xcel'), 'section' => $section, 'type' => 'upsell'); // Site Text Settings $section = 'xcel-setting-website'; $sections[] = array('id' => $section, 'title' => __('Website Text', 'xcel'), 'priority' => '50'); // Upsell Button Nine $options['xcel-setting-upsell-nine'] = array('id' => 'xcel-setting-upsell-nine', 'label' => __('Edit Footer Copyright Text', 'xcel'), 'section' => $section, 'type' => 'upsell'); $options['xcel-setting-website-error-head'] = array('id' => 'xcel-setting-website-error-head', 'label' => __('404 Error Page Heading', 'xcel'), 'section' => $section, 'type' => 'text', 'default' => __('Oops! <span>404</span>', 'xcel'), 'description' => __('Enter the heading for the 404 Error page', 'xcel')); $options['xcel-setting-website-error-msg'] = array('id' => 'xcel-setting-website-error-msg', 'label' => __('Error 404 Message', 'xcel'), 'section' => $section, 'type' => 'textarea', 'default' => __('It looks like that page does not exist. <br />Return home or try a search', 'xcel'), 'description' => __('Enter the default text on the 404 error page (Page not found)', 'xcel')); $options['xcel-setting-website-nosearch-msg'] = array('id' => 'xcel-setting-website-nosearch-msg', 'label' => __('No Search Results', 'xcel'), 'section' => $section, 'type' => 'textarea', 'default' => __('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'xcel'), 'description' => __('Enter the default text for when no search results are found', 'xcel')); // Adds the sections to the $options array $options['sections'] = $sections; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
/** * Defines customizer options * * @package Customizer Library squarely */ function customizer_library_squarely_options() { // Theme defaults $brand_primary = '#02c0a7'; $brand_success = '#FF4A4F'; $brand_secondary = '#f1c40f'; $brand_info = '#B5BC18'; $c_gray = '#404040'; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); $panels = array(); // Stores all the controls to be added $control = array(); // Adds the sections to the $options array $options['sections'] = $sections; /*///////////////////////////////// /* Sections & Section Panels /*/ //////////////////////////////// $panel = 'header-navbar'; $panels[] = array('id' => $panel, 'title' => __('Home Hero & Navbar', 'squarely'), 'priority' => '0'); $section = 'colors_type'; $sections[] = array('id' => $section, 'title' => __('Theme Colors', 'squarely'), 'priority' => '0'); $section = 'typography'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Typography', 'squarely'), 'priority' => '0'); $section = 'layout_design'; $sections[] = array('id' => $section, 'title' => __('Layout & Design', 'squarely'), 'priority' => '0'); $section = 'social'; $sections[] = array('id' => $section, 'title' => __('Social', 'squarely'), 'priority' => '0'); $section = 'footer'; $sections[] = array('id' => $section, 'title' => __('Footer', 'squarely'), 'priority' => '0'); $section = 'contact_info'; $sections[] = array('id' => $section, 'title' => __('Contact Information', 'squarely'), 'priority' => '0'); /*///////////////////////////////// /* Options - Contact Info /*/ //////////////////////////////// $options['telephone'] = array('id' => 'telephone', 'label' => __('Telephone Number', 'squarely'), 'section' => 'contact_info', 'type' => 'text'); $options['e-mail'] = array('id' => 'e-mail', 'label' => __('E-Mail', 'squarely'), 'section' => 'contact_info', 'type' => 'text'); $options['address'] = array('id' => 'address', 'label' => __('Address', 'squarely'), 'section' => 'contact_info', 'type' => 'text'); /*///////////////////////////////// /* Options - Social /*/ //////////////////////////////// $options['c-facebook'] = array('id' => 'c-facebook', 'label' => __('Include Facebook Profile', 'textdomain'), 'section' => 'social', 'type' => 'checkbox', 'default' => 0); $options['c-twitter'] = array('id' => 'c-twitter', 'label' => __('Include Twitter Profile', 'textdomain'), 'section' => 'social', 'type' => 'checkbox', 'default' => 0); $options['c-google'] = array('id' => 'c-google', 'label' => __('Include Google+ Profile', 'textdomain'), 'section' => 'social', 'type' => 'checkbox', 'default' => 0); $options['f-facebook'] = array('id' => 'f-facebook', 'label' => __('Facebook URL', 'squarely'), 'description' => __('Your Facebook URL starting with "http://"...', 'squarely'), 'section' => 'social', 'type' => 'url'); $options['f-twitter'] = array('id' => 'f-twitter', 'label' => __('Twitter URL', 'squarely'), 'description' => __('Your Twitter URL starting with "http://"...', 'squarely'), 'section' => 'social', 'type' => 'url'); $options['f-google'] = array('id' => 'f-google', 'label' => __('Google Plus URL', 'squarely'), 'description' => __('Your Plus URL starting with "http://"...', 'squarely'), 'section' => 'social', 'type' => 'url'); $options['f-linkedin'] = array('id' => 'f-linkedin', 'label' => __('LinkedIn URL', 'squarely'), 'description' => __('Your LinkedIn URL starting with "http://"...', 'squarely'), 'section' => 'social', 'type' => 'url'); $options['f-youtube'] = array('id' => 'f-youtube', 'label' => __('YouTube URL', 'squarely'), 'description' => __('Your YouTube Channel URL starting with "http://"...', 'squarely'), 'section' => 'social', 'type' => 'url'); $options['f-rss'] = array('id' => 'f-rss', 'label' => __('RSS URL', 'squarely'), 'description' => __('Your RSS URL starting with "http://"...', 'squarely'), 'section' => 'social', 'type' => 'url'); /*///////////////////////////////// /* Options - Footer /*/ //////////////////////////////// $options['f-copyright'] = array('id' => 'f-copyright', 'label' => __('Copyright Line', 'squarely'), 'description' => __('The Footer Copyright Line', 'squarely'), 'section' => 'footer', 'type' => 'text'); /*///////////////////////////////// /* Header & Navbar Sub Sections /*/ //////////////////////////////// $section = 'logo'; $sections[] = array('id' => $section, 'title' => __('Navbar Logo & Color', 'squarely'), 'description' => __('Control your header\'s logo, colors, and link colors', 'squarely'), 'priority' => '30', 'panel' => 'header-navbar'); $section = 'header-options'; $sections[] = array('id' => $section, 'title' => __('Hero Text & Background', 'squarely'), 'priority' => '40', 'panel' => 'header-navbar'); $section = 'header-buttons'; $sections[] = array('id' => $section, 'title' => __('Hero Buttons', 'squarely'), 'priority' => '50', 'panel' => 'header-navbar'); $section = 'header-scripts'; $sections[] = array('id' => $section, 'title' => __('Additional Scripts', 'squarely'), 'description' => __('Analytics Scripts & Custom Scripts', 'squarely'), 'priority' => '60', 'panel' => 'header-navbar'); /*///////////////////////////////// /* Options Header & Navbar /*/ //////////////////////////////// $options['logo'] = array('id' => 'logo', 'label' => __('Logo', 'squarely'), 'section' => 'logo', 'type' => 'image', 'default' => ''); $options['nav-background'] = array('id' => 'nav-background', 'label' => __('Navbar Color', 'squarely'), 'description' => __('Choose the background color of your site wide navigation bar', 'squarely'), 'section' => 'logo', 'type' => 'color', 'default' => '#fffff'); $options['scripts-google'] = array('id' => 'scripts-google', 'label' => __('Google Analytics ID', 'squarely'), 'section' => 'header-scripts', 'type' => 'text'); $options['add-scripts'] = array('id' => 'add-scripts', 'label' => __('Custom Scripts for Header', 'squarely'), 'section' => 'header-scripts', 'type' => 'textarea'); $options['editor'] = array('id' => 'editor', 'label' => __('Custom Scripts for Header', 'squarely'), 'section' => 'header-scripts', 'type' => 'editor'); $options['header-hero'] = array('id' => 'header-hero', 'label' => __('Header Hero Image', 'squarely'), 'section' => 'header-options', 'type' => 'image'); $options['header-subtitle'] = array('id' => 'header-subtitle', 'label' => __('Hero Small Subtitle', 'squarely'), 'section' => 'header-options', 'type' => 'text', 'default' => 'THANKS FOR SAYING HELLO TO'); $options['header-h1'] = array('id' => 'header-h1', 'label' => __('Hero Header H1 Title', 'squarely'), 'section' => 'header-options', 'type' => 'text', 'default' => 'Squarely Wordpress Theme'); $options['header-h2'] = array('id' => 'header-h2', 'label' => __('Hero Header Secondary H2 Title', 'squarely'), 'section' => 'header-options', 'type' => 'text', 'default' => 'Tailored-Made Development, Creative, Strategy & Management'); $options['btn-l-label'] = array('id' => 'btn-l-label', 'label' => __('Hero Left Button Label', 'squarely'), 'section' => 'header-buttons', 'type' => 'text', 'default' => 'LEARN MORE'); $options['btn-l-url'] = array('id' => 'btn-l-url', 'label' => __('Hero Left Button URL Input', 'squarely'), 'section' => 'header-buttons', 'type' => 'url'); $options['btn-r-label'] = array('id' => 'btn-r-label', 'label' => __('Hero Right Button Label', 'squarely'), 'section' => 'header-buttons', 'type' => 'text', 'default' => 'OUR SERVICES'); $options['btn-r-url'] = array('id' => 'btn-r-url', 'label' => __('Hero Right Button URL Input', 'squarely'), 'section' => 'header-buttons', 'type' => 'url'); /*///////////////////////////////// /* Options Colors & Typography /*/ //////////////////////////////// $options['primary-font'] = array('id' => 'primary-font', 'label' => __('Primary Font', 'squarely'), 'section' => 'typography', 'type' => 'select', 'choices' => $font_choices, 'default' => 'Monoton'); $options['secondary-font'] = array('id' => 'secondary-font', 'label' => __('Script, Decorative Font using the .script class', 'squarely'), 'section' => 'typography', 'type' => 'select', 'choices' => $font_choices, 'default' => 'Merriweather'); $options['body_font_color'] = array('id' => 'body_font_color', 'label' => __('Base Font Color', 'squarely'), 'section' => 'typography', 'type' => 'color', 'default' => $c_gray); $options['body_background'] = array('id' => 'body_background', 'label' => __('Base Background Color', 'squarely'), 'section' => 'colors_type', 'type' => 'color', 'default' => '#fffff'); $options['brand-primary'] = array('id' => 'brand-primary', 'label' => __('Brand Primary', 'squarely'), 'description' => __('Filled Buttons, Icons, and elements using the ".primary-bg or .brand-primary" class', 'squarely'), 'section' => 'colors_type', 'type' => 'color', 'default' => $brand_primary); $options['brand-secondary'] = array('id' => 'brand-secondary', 'label' => __('Brand Secondary', 'squarely'), 'description' => __('Filled Buttons, Icons, and elements using the ".secondary-bg or .brand-secondary" class', 'squarely'), 'section' => 'colors_type', 'type' => 'color', 'default' => $brand_secondary); $options['brand-success'] = array('id' => 'brand-success', 'label' => __('Brand Success', 'squarely'), 'description' => __('Filled Buttons, Icons, and elements using the ".success-bg or .brand-success" class', 'squarely'), 'section' => 'colors_type', 'type' => 'color', 'default' => $brand_success); $options['brand-info'] = array('id' => 'brand-info', 'label' => __('Brand Info', 'squarely'), 'description' => __('Filled Buttons, Icons, and elements using the ".info-bg or .brand-info" class', 'squarely'), 'section' => 'colors_type', 'type' => 'color', 'default' => $brand_info); // Adds the sections to the $options array $options['sections'] = $sections; // Adds the panels to the $options array $options['panels'] = $panels; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
/** * Defines customizer options * * @package Customizer Library Demo */ function customizer_library_topshop_options() { // Theme defaults $primary_color = '#29a6e5'; $secondary_color = '#266ee4'; $body_font_color = '#4F4F4F'; $heading_font_color = '#5E5E5E'; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Adds the sections to the $options array $options['sections'] = $sections; // Logo $section = 'topshop-favicon'; $sections[] = array('id' => $section, 'title' => __('Favicon', 'topshop'), 'priority' => '10', 'description' => __('Add a favicon to your website', 'topshop')); $options['topshop-header-favicon'] = array('id' => 'topshop-header-favicon', 'label' => __('Favicon', 'topshop'), 'section' => $section, 'type' => 'image', 'default' => ''); // Layout Settings $section = 'topshop-layout'; $sections[] = array('id' => $section, 'title' => __('Layout Options', 'topshop'), 'priority' => '30'); // Upsell Button One $options['topshop-upsell-one'] = array('id' => 'topshop-upsell-one', 'label' => __('Site Layout', 'topshop'), 'section' => $section, 'type' => 'upsell'); // Upsell Button Two $options['topshop-upsell-two'] = array('id' => 'topshop-upsell-two', 'label' => __('Header Layout', 'topshop'), 'section' => $section, 'type' => 'upsell'); $options['topshop-header-search'] = array('id' => 'topshop-header-search', 'label' => __('Show Search', 'topshop'), 'section' => $section, 'type' => 'checkbox', 'description' => __('Enable to a slogan for your site. This uses the site Tagline', 'topshop'), 'default' => 1); $options['topshop-sticky-header'] = array('id' => 'topshop-sticky-header', 'label' => __('Sticky Header', 'topshop'), 'section' => $section, 'type' => 'checkbox', 'description' => __('Select this box to make the main navigation sticky', 'topshop'), 'default' => 0); $options['topshop-show-header-top-bar'] = array('id' => 'topshop-show-header-top-bar', 'label' => __('Show Top Bar', 'topshop'), 'section' => $section, 'type' => 'checkbox', 'description' => __('This will show/hide the top bar in the header<br /><a href="http://kairaweb.com/support/topic/settings-not-showing-on-theme/" target="_blank">Not working? See here</a><br /><br /><a href="http://kairaweb.com/support/topic/topshop-hooks-for-developers/" target="_blank">TopShop Premium has hooks</a> integrated for developers to hook on to.', 'topshop'), 'default' => 1); // Blog Settings $section = 'topshop-slider'; $sections[] = array('id' => $section, 'title' => __('Slider Options', 'topshop'), 'priority' => '35'); $choices = array('topshop-slider-default' => 'Default Slider', 'topshop-meta-slider' => 'Meta Slider', 'topshop-no-slider' => 'None'); $options['topshop-slider-type'] = array('id' => 'topshop-slider-type', 'label' => __('Choose a Slider', 'topshop'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'topshop-slider-default'); $options['topshop-slider-cats'] = array('id' => 'topshop-slider-cats', 'label' => __('Slider Categories', 'topshop'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the ID\'s of the post categories you want to display in the slider. Eg: "13,17,19" (no spaces and only comma\'s)<br /><a href="http://kairaweb.com/support/topic/setting-up-the-default-slider/" target="_blank"><b>Follow instructions here</b></a>', 'topshop')); $options['topshop-meta-slider-shortcode'] = array('id' => 'topshop-meta-slider-shortcode', 'label' => __('Slider Shortcode', 'topshop'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the shortcode give by meta slider.', 'topshop')); // Upsell Button Slider $options['topshop-upsell-two-one'] = array('id' => 'topshop-upsell-two-one', 'label' => __('Extra Slider Settings', 'topshop'), 'section' => $section, 'type' => 'upsell'); // Colors $section = 'topshop-styling'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Styling Options', 'topshop'), 'priority' => '38'); $options['topshop-main-color'] = array('id' => 'topshop-main-color', 'label' => __('Main Color', 'topshop'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['topshop-main-color-hover'] = array('id' => 'topshop-main-color-hover', 'label' => __('Secondary Color', 'topshop'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); $options['topshop-body-font'] = array('id' => 'topshop-body-font', 'label' => __('Body Font', 'topshop'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Open Sans'); $options['topshop-body-font-color'] = array('id' => 'topshop-body-font-color', 'label' => __('Body Font Color', 'topshop'), 'section' => $section, 'type' => 'color', 'default' => $body_font_color); $options['topshop-heading-font'] = array('id' => 'topshop-heading-font', 'label' => __('Headings Font', 'topshop'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Raleway'); $options['topshop-heading-font-color'] = array('id' => 'topshop-heading-font-color', 'label' => __('Heading Font Color', 'topshop'), 'section' => $section, 'type' => 'color', 'default' => $heading_font_color); // Upsell Button Styling $options['topshop-upsell-two-two'] = array('id' => 'topshop-upsell-two-two', 'label' => __('Extra Styling options', 'topshop'), 'section' => $section, 'type' => 'upsell'); $options['topshop-custom-css'] = array('id' => 'topshop-custom-css', 'label' => __('Custom CSS', 'topshop'), 'section' => $section, 'type' => 'textarea', 'default' => __('', 'topshop'), 'description' => __('Add custom CSS to your theme', 'topshop')); // Blog Settings $section = 'topshop-blog'; $sections[] = array('id' => $section, 'title' => __('Blog Options', 'topshop'), 'priority' => '50'); // Upsell Button Three $options['topshop-upsell-three'] = array('id' => 'topshop-upsell-three', 'label' => __('Blog Post Layout', 'topshop'), 'section' => $section, 'type' => 'upsell'); $options['topshop-blog-title'] = array('id' => 'topshop-blog-title', 'label' => __('Blog Page Title', 'topshop'), 'section' => $section, 'type' => 'text', 'default' => 'Blog'); $options['topshop-blog-cats'] = array('id' => 'topshop-blog-cats', 'label' => __('Exclude Blog Categories', 'topshop'), 'section' => $section, 'type' => 'text', 'description' => __('Enter the ID\'s of the post categories you\'d like to EXCLUDE from the Blog, enter only the ID\'s with a minus sign (-) before them, separated by a comma (,)<br />Eg: "-13, -17, -19"<br />If you enter the ID\'s without the minus then it\'ll show ONLY posts in those categories.', 'topshop')); $choices = array('blog-use-images-loop' => 'Post Images Carousel', 'blog-use-featured-image' => 'Use only the featured image'); $options['topshop-blog-list-image-type'] = array('id' => 'topshop-blog-list-image-type', 'label' => __('Blog List Image', 'topshop'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'blog-use-featured-image'); // Social Settings $section = 'topshop-social'; $sections[] = array('id' => $section, 'title' => __('Social Links', 'topshop'), 'priority' => '80'); // Upsell Button Four $options['topshop-upsell-four'] = array('id' => 'topshop-upsell-four', 'label' => __('Add Social Links', 'topshop'), 'section' => $section, 'type' => 'upsell'); // Site Text Settings $section = 'topshop-website'; $sections[] = array('id' => $section, 'title' => __('Website Text', 'topshop'), 'priority' => '50'); $options['topshop-header-info-text'] = array('id' => 'topshop-header-info-text', 'label' => __('Header Info Text', 'topshop'), 'section' => $section, 'type' => 'text', 'default' => __('Call Us: 082 444 BOOM', 'topshop'), 'description' => __('This is the text in the header', 'topshop')); // Upsell Button Five $options['topshop-upsell-five'] = array('id' => 'topshop-upsell-five', 'label' => __('Site Copy Text', 'topshop'), 'section' => $section, 'type' => 'upsell'); $options['topshop-website-error-head'] = array('id' => 'topshop-website-error-head', 'label' => __('404 Error Page Heading', 'topshop'), 'section' => $section, 'type' => 'text', 'default' => __('Oops! <span>404</span>', 'topshop'), 'description' => __('Enter the heading for the 404 Error page', 'topshop')); $options['topshop-website-error-msg'] = array('id' => 'topshop-website-error-msg', 'label' => __('Error 404 Message', 'topshop'), 'section' => $section, 'type' => 'textarea', 'default' => __('It looks like that page does not exist. <br />Return home or try a search', 'topshop'), 'description' => __('Enter the default text on the 404 error page (Page not found)', 'topshop')); $options['topshop-website-nosearch-msg'] = array('id' => 'topshop-website-nosearch-msg', 'label' => __('No Search Results', 'topshop'), 'section' => $section, 'type' => 'textarea', 'default' => __('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'topshop'), 'description' => __('Enter the default text for when no search results are found', 'topshop')); // Adds the sections to the $options array $options['sections'] = $sections; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }
function customizer_library_options() { global $default_options; // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Stores all the panels to be added $panels = array(); // Adds the sections to the $options array $options['sections'] = $sections; /* --- header options --- */ $panels[] = array('id' => "panel-header", 'title' => __('Header', 'cumulo'), 'priority' => '80'); $sections[] = array('id' => "section-header-style", 'title' => __('Style', 'cumulo'), 'priority' => '80', 'panel' => "panel-header"); $options['header-show-header'] = array('id' => 'header-show-header', 'label' => __('Show Header', 'cumulo'), 'section' => "section-header-style", 'type' => 'checkbox', 'default' => $default_options['header-show-header']); $options['header-style'] = array('id' => 'header-style', 'label' => __('Header Style', 'cumulo'), 'section' => "section-header-style", 'type' => 'select', 'choices' => array("style-1" => __("Style 1", 'cumulo'), "style-2" => __("Style 2 ( Image Background )", 'cumulo'), "style-3" => __("Style 3", 'cumulo'), "style-4" => __("Style 4", 'cumulo'), "style-5" => __("Style 5", 'cumulo'), "style-6" => __("Style 6", 'cumulo')), 'default' => $default_options['header-style']); $options['header-background-image'] = array('id' => 'header-background-image', 'label' => __('Header Background Image', 'cumulo'), 'section' => "section-header-style", 'type' => 'image', 'default' => $default_options['header-background-image'], 'description' => __('This option works with header style 2 only.', 'cumulo'), 'active_callback' => cmo_handle_customizer_dependancy('header-style', 'style-2')); $options['header-background-repeat'] = array('id' => 'header-background-repeat', 'label' => __('Header Background Repeat', 'cumulo'), 'section' => "section-header-style", 'type' => 'radio', 'choices' => array('cover' => __('Cover', 'cumulo'), 'repeat' => __('Tile', 'cumulo'), 'repeat-x' => __('Tile Horizontally', 'cumulo'), 'repeat-y' => __('Tile Vertically', 'cumulo'), 'no-repeat' => __('No Repeat', 'cumulo')), 'default' => $default_options['header-background-repeat'], 'active_callback' => cmo_handle_customizer_dependancy('header-style', 'style-2')); $options['header-transparent-header'] = array('id' => 'header-transparent-header', 'label' => __('Enable Transparent Header', 'cumulo'), 'section' => "section-header-style", 'type' => 'checkbox', 'default' => $default_options['header-transparent-header']); $sections[] = array('id' => "section-header-logo", 'title' => __('Logo', 'cumulo'), 'priority' => '80', 'panel' => "panel-header"); $options['header-logo'] = array('id' => 'header-logo', 'label' => __('Header Logo', 'cumulo'), 'section' => "section-header-logo", 'type' => 'image', 'default' => $default_options['header-logo']); $options['header-logo-margin-top'] = array('id' => 'header-logo-margin-top', 'label' => __('Logo Top Margin', 'cumulo'), 'section' => "section-header-logo", 'type' => 'text', 'default' => $default_options['header-logo-margin-top'], 'transport' => 'postMessage'); $options['header-transparent-header-logo'] = array('id' => 'header-transparent-header-logo', 'label' => __('Logo on Transparent Header', 'cumulo'), 'section' => "section-header-logo", 'type' => 'image', 'default' => $default_options['header-transparent-header-logo'], 'description' => __('Leave it empty for default logo', 'cumulo')); $sections[] = array('id' => "section-header-infobar", 'title' => __('Information Bar', 'cumulo'), 'priority' => '80', 'panel' => "panel-header"); $options['header-infobar-visible'] = array('id' => 'header-infobar-visible', 'label' => __('Show Infomation Bar', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'checkbox', 'default' => $default_options['header-infobar-visible']); $options['header-infobar-phone'] = array('id' => 'header-infobar-phone', 'label' => __('Phone NO', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => $default_options['header-infobar-phone'], 'transport' => 'postMessage'); $options['header-infobar-email'] = array('id' => 'header-infobar-email', 'label' => __('Email', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => $default_options['header-infobar-email'], 'transport' => 'postMessage'); $options['header-social-twitter'] = array('id' => 'header-social-twitter', 'label' => __('Twitter', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-linkedin'] = array('id' => 'header-social-linkedin', 'label' => __('LinkedIn', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-facebook'] = array('id' => 'header-social-facebook', 'label' => __('Facebook', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-skype'] = array('id' => 'header-social-skype', 'label' => __('Skype', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-google-plus'] = array('id' => 'header-social-google-plus', 'label' => __('Google+', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-dribbble'] = array('id' => 'header-social-dribbble', 'label' => __('Dribbble', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-pinterest'] = array('id' => 'header-social-pinterest', 'label' => __('Pinterest', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-apple'] = array('id' => 'header-social-apple', 'label' => __('Apple', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-instagram'] = array('id' => 'header-social-instagram', 'label' => __('Instagram', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-youtube'] = array('id' => 'header-social-youtube', 'label' => __('Youtube', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-vimeo-square'] = array('id' => 'header-social-vimeo-square', 'label' => __('Vimeo', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['header-social-rss'] = array('id' => 'header-social-rss', 'label' => __('RSS', 'cumulo'), 'section' => "section-header-infobar", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $sections[] = array('id' => "section-header-menu", 'title' => __('Menu', 'cumulo'), 'priority' => '80', 'panel' => "panel-header"); $options['header-show-menu'] = array('id' => 'header-show-menu', 'label' => __('Show Menu', 'cumulo'), 'section' => "section-header-menu", 'type' => 'checkbox', 'default' => $default_options['header-show-menu']); $options['header-menu-sticky'] = array('id' => 'header-menu-sticky', 'label' => __('Enable Sticky Menu', 'cumulo'), 'section' => "section-header-menu", 'type' => 'checkbox', 'default' => $default_options['header-menu-sticky']); $options['header-menu-show-cart'] = array('id' => 'header-menu-show-cart', 'label' => __('Show WooCommerce Cart Icon on Header', 'cumulo'), 'section' => "section-header-menu", 'type' => 'checkbox', 'default' => $default_options['header-menu-show-cart'], 'description' => __("Cart icon may not be visible in header style 4", 'cumulo')); $options['header-menu-show-search'] = array('id' => 'header-menu-show-search', 'label' => __('Show Search Icon', 'cumulo'), 'section' => "section-header-menu", 'type' => 'checkbox', 'default' => $default_options['header-menu-show-search'], 'description' => __("Search icon may not be visible in header style 4", 'cumulo')); $sections[] = array('id' => "section-header-breadcrumb", 'title' => __('Breadcrumb', 'cumulo'), 'priority' => '80', 'panel' => "panel-header"); $options['header-breadcrumb-show'] = array('id' => 'header-breadcrumb-show', 'label' => __('Show Breadcrumb', 'cumulo'), 'section' => "section-header-breadcrumb", 'type' => 'checkbox', 'default' => $default_options['header-breadcrumb-show'], 'description' => __('Breadcrumb is not visible on homepage by default', 'cumulo')); $options['breadcrumb-background-image-enable'] = array('id' => 'breadcrumb-background-image-enable', 'label' => __('Breadcrumb Background Image', 'cumulo'), 'section' => "section-header-breadcrumb", 'type' => 'checkbox', 'default' => $default_options['breadcrumb-background-image-enable'], 'description' => __('Check this to use background image for breadcrumb.', 'cumulo')); $options['header-breadcrumb-image'] = array('id' => 'header-breadcrumb-image', 'label' => __('Select Breadcrumb Background Image', 'cumulo'), 'section' => "section-header-breadcrumb", 'type' => 'image', 'default' => '', 'description' => __('Default Image will be used if not set.', 'cumulo'), 'active_callback' => cmo_handle_customizer_dependancy('breadcrumb-background-image-enable', 1)); $options['breadcrumb-background-repeat'] = array('id' => 'breadcrumb-background-repeat', 'label' => __('Breadcrumb Background Repeat', 'cumulo'), 'section' => "section-header-breadcrumb", 'type' => 'radio', 'choices' => array('cover' => __('Cover', 'cumulo'), 'repeat' => __('Tile', 'cumulo'), 'repeat-x' => __('Tile Horizontally', 'cumulo'), 'repeat-y' => __('Tile Vertically', 'cumulo'), 'no-repeat' => __('No Repeat', 'cumulo')), 'default' => $default_options['breadcrumb-background-repeat'], 'active_callback' => cmo_handle_customizer_dependancy('breadcrumb-background-image-enable', 1)); $options['breadcrumb-background-overlay'] = array('id' => 'breadcrumb-background-overlay', 'label' => __('Enable Breadcrumb Background Overlay', 'cumulo'), 'section' => "section-header-breadcrumb", 'type' => 'checkbox', 'default' => $default_options['breadcrumb-background-overlay'], 'description' => __('Check this to use background overlay for breadcrumb.', 'cumulo')); /* --- end of header options --- */ /* --- footer options --- */ $panels[] = array('id' => "panel-footer", 'title' => __('Footer', 'cumulo'), 'priority' => '81'); $sections[] = array('id' => "section-footer-style", 'title' => __('Style', 'cumulo'), 'priority' => '80', 'panel' => "panel-footer"); $options['footer-style'] = array('id' => 'footer-style', 'label' => __('Footer Style', 'cumulo'), 'section' => "section-footer-style", 'type' => 'select', 'choices' => array("style-1" => "Style 1", "style-2" => "Style 2", "style-3" => "Style 3", "style-4" => "Style 4"), 'default' => $default_options['footer-style']); $options['footer-show-footer'] = array('id' => 'footer-show-footer', 'label' => __('Show Footer', 'cumulo'), 'section' => "section-footer-style", 'type' => 'checkbox', 'default' => $default_options['footer-show-footer']); $options['footer-show-copyright'] = array('id' => 'footer-show-copyright', 'label' => __('Show Footer Copyright Bar', 'cumulo'), 'section' => "section-footer-style", 'type' => 'checkbox', 'default' => $default_options['footer-show-footer']); $sections[] = array('id' => "section-footer-logo", 'title' => __('Logo', 'cumulo'), 'priority' => '80', 'panel' => "panel-footer"); $options['footer-logo'] = array('id' => 'footer-logo', 'label' => __('Footer Logo', 'cumulo'), 'section' => "section-footer-logo", 'type' => 'image', 'default' => $default_options['footer-logo'], 'description' => __('Footer Logo works with shortcode [cmo_footer_logo]. Default is same with Header Logo', 'cumulo')); $sections[] = array('id' => "section-footer-social", 'title' => __('Social Links', 'cumulo'), 'priority' => '80', 'panel' => "panel-footer", 'description' => __('Footer Social works with [cmo_footer_social] shortcode', 'cumulo')); $options['footer-social-twitter'] = array('id' => 'footer-social-twitter', 'label' => __('Twitter', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-linkedin-square'] = array('id' => 'footer-social-linkedin-square', 'label' => __('LinkedIn', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-facebook-square'] = array('id' => 'footer-social-facebook-square', 'label' => __('Facebook', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-skype'] = array('id' => 'footer-social-skype', 'label' => __('Skype', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-google-plus'] = array('id' => 'footer-social-google-plus', 'label' => __('Google+', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-dribbble'] = array('id' => 'footer-social-dribbble', 'label' => __('Dribbble', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-pinterest'] = array('id' => 'footer-social-pinterest', 'label' => __('Pinterest', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-apple'] = array('id' => 'footer-social-apple', 'label' => __('Apple', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-instagram'] = array('id' => 'footer-social-instagram', 'label' => __('Instagram', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-youtube'] = array('id' => 'footer-social-youtube', 'label' => __('Youtube', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-vimeo-square'] = array('id' => 'footer-social-vimeo-square', 'label' => __('Vimeo', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $options['footer-social-rss'] = array('id' => 'footer-social-rss', 'label' => __('RSS', 'cumulo'), 'section' => "section-footer-social", 'type' => 'text', 'default' => '', 'transport' => 'postMessage'); $sections[] = array('id' => "section-footer-extra-info", 'title' => __('Extra Information', 'cumulo'), 'priority' => '80', 'panel' => "panel-footer", 'description' => __('Phone Numbers, Email, Address will be used in footer style 3, 4 by default, For use in other places, use shortcode [cmo_contact_info type="phone|email|address" icon="Override Icon"]Override Information[/cmo_contact_info] in text widget', 'cumulo')); $options['footer-copyright-text'] = array('id' => 'footer-copyright-text', 'label' => __('Copyright', 'cumulo'), 'section' => "section-footer-extra-info", 'type' => 'text', 'default' => $default_options['footer-copyright-text'], 'transport' => 'postMessage'); $options['footer-extra-phone'] = array('id' => 'footer-extra-phone', 'label' => __('Phone Numbers', 'cumulo'), 'section' => "section-footer-extra-info", 'type' => 'text', 'default' => $default_options['footer-extra-phone'], 'description' => __('For multiple numbers, separate with | sign', 'cumulo')); $options['footer-extra-email'] = array('id' => 'footer-extra-email', 'label' => __('Email Addresses', 'cumulo'), 'section' => "section-footer-extra-info", 'type' => 'text', 'default' => $default_options['footer-extra-email'], 'description' => __('For multiple email, separate with | sign', 'cumulo')); $options['footer-extra-address'] = array('id' => 'footer-extra-address', 'label' => __('Address', 'cumulo'), 'section' => "section-footer-extra-info", 'type' => 'text', 'default' => $default_options['footer-extra-address'], 'description' => __('For line break, use | sign', 'cumulo')); $sections[] = array('id' => "section-footer-widgets", 'title' => __('Footer Widgets', 'cumulo'), 'priority' => '80', 'panel' => "panel-footer"); $options['footer-widget-1'] = array('id' => 'footer-widget-1', 'label' => __('Select Sidebar for Footer Column 1', 'cumulo'), 'section' => "section-footer-widgets", 'type' => 'select', 'choices' => cmo_get_all_sidebars(__("None", 'cumulo')), 'default' => $default_options['footer-widget-1'], 'description' => __('Following 4 options works with Footer Style 1 and 2', 'cumulo')); $options['footer-widget-2'] = array('id' => 'footer-widget-2', 'label' => __('Select Sidebar for Footer Column 2', 'cumulo'), 'section' => "section-footer-widgets", 'type' => 'select', 'choices' => cmo_get_all_sidebars(__("None", 'cumulo')), 'default' => $default_options['footer-widget-2']); $options['footer-widget-3'] = array('id' => 'footer-widget-3', 'label' => __('Select Sidebar for Footer Column 3', 'cumulo'), 'section' => "section-footer-widgets", 'type' => 'select', 'choices' => cmo_get_all_sidebars(__("None", 'cumulo')), 'default' => $default_options['footer-widget-3']); $options['footer-widget-4'] = array('id' => 'footer-widget-4', 'label' => __('Select Sidebar for Footer Column 4', 'cumulo'), 'section' => "section-footer-widgets", 'type' => 'select', 'choices' => cmo_get_all_sidebars(__("None", 'cumulo')), 'default' => $default_options['footer-widget-4']); /* --- end of footer options --- */ /* Color options */ $section = 'colors'; $sections[] = array('id' => $section, 'title' => __('Colors', 'cumulo'), 'priority' => '90', 'description' => __('Change overall color settings here. These settings will be applied to all elements, but specific color settings such as shortcode color options will have higher priority.', 'cumulo')); $options['primary-color'] = array('id' => 'primary-color', 'label' => __('Primary Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['primary-color']); $options['text-color'] = array('id' => 'text-color', 'label' => __('Text Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['text-color']); $options['heading-color'] = array('id' => 'heading-color', 'label' => __('Heading Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['heading-color']); $options['bg-color'] = array('id' => 'bg-color', 'label' => __('Primary Background Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['bg-color']); $options['bg-color2'] = array('id' => 'bg-color2', 'label' => __('Secondary Background Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['bg-color2']); $options['dark-bg-color'] = array('id' => 'dark-bg-color', 'label' => __('Dark Background Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['dark-bg-color'], 'description' => __('Dark Background Color will be used as overlay or background color on hover', 'cumulo')); $options['menu-color'] = array('id' => 'menu-color', 'label' => __('Menu Item Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['menu-color']); $options['header-bg-color'] = array('id' => 'header-bg-color', 'label' => __('Header Background Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['header-bg-color']); $options['breadcrumb-bg-color'] = array('id' => 'breadcrumb-bg-color', 'label' => __('Breadcrumb Background Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['breadcrumb-bg-color']); $options['border-color'] = array('id' => 'border-color', 'label' => __('Border Color', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['border-color']); $options['transparent-header-nav-alt-color'] = array('id' => 'transparent-header-nav-alt-color', 'label' => __('Enable Alternative Main Navigation Color', 'cumulo'), 'section' => $section, 'type' => 'checkbox', 'default' => $default_options['transparent-header-nav-alt-color'], 'description' => __("Enable Alternative Color for Transparent Header", 'cumulo')); $options['transparent-header-main-nav-color'] = array('id' => 'transparent-header-main-nav-color', 'label' => __('Color for Transparent Header', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['transparent-header-main-nav-color'], 'description' => __('Main Navigation Color on Transparent Header. It work with transparent header enabled', 'cumulo'), 'active_callback' => cmo_handle_customizer_dependancy('transparent-header-nav-alt-color', '1')); /* End of Color options */ /* Typography */ $section = 'typography'; $font_choices = customizer_library_get_font_choices(); $sections[] = array('id' => $section, 'title' => __('Typography', 'cumulo'), 'priority' => '90', 'description' => __('Change global font options. If you select google fonts from the list, they will be automatically loaded from Google Fonts.', 'cumulo')); $options['heading-font'] = array('id' => 'heading-font', 'label' => __('Heading Font', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => $default_options['heading-font']); $options['heading-font-weight'] = array('id' => 'heading-font-weight', 'label' => __('Heading Font Weight', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => cmo_get_font_weights(true), 'default' => $default_options['heading-font-weight']); $options['sub-heading-font'] = array('id' => 'sub-heading-font', 'label' => __('Sub Heading Font', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => $default_options['heading-font']); $options['sub-heading-font-weight'] = array('id' => 'sub-heading-font-weight', 'label' => __('Sub Heading Font Weight', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => cmo_get_font_weights(true), 'default' => $default_options['heading-font-weight']); $options['h1-font-size'] = array('id' => 'h1-font-size', 'label' => __('H1 Tag Font Size', 'cumulo'), 'section' => $section, 'type' => 'text', 'default' => $default_options['h1-font-size']); $options['h2-font-size'] = array('id' => 'h2-font-size', 'label' => __('H2 Tag Font Size', 'cumulo'), 'section' => $section, 'type' => 'text', 'default' => $default_options['h2-font-size']); $options['h3-font-size'] = array('id' => 'h3-font-size', 'label' => __('H3 Tag Font Size', 'cumulo'), 'section' => $section, 'type' => 'text', 'default' => $default_options['h3-font-size']); $options['h4-font-size'] = array('id' => 'h4-font-size', 'label' => __('H4 Tag Font Size', 'cumulo'), 'section' => $section, 'type' => 'text', 'default' => $default_options['h4-font-size']); $options['h5-font-size'] = array('id' => 'h5-font-size', 'label' => __('H5 Tag Font Size', 'cumulo'), 'section' => $section, 'type' => 'text', 'default' => $default_options['h5-font-size']); $options['h6-font-size'] = array('id' => 'h6-font-size', 'label' => __('H6 Tag Font Size', 'cumulo'), 'section' => $section, 'type' => 'text', 'default' => $default_options['h6-font-size']); $options['text-font'] = array('id' => 'text-font', 'label' => __('Text Font', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => $default_options['text-font']); $options['text-font-weight'] = array('id' => 'text-font-weight', 'label' => __('Text Font Weight', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => cmo_get_font_weights(), 'default' => $default_options['text-font-weight']); $options['text-font-size'] = array('id' => 'text-font-size', 'label' => __('Text Font Size', 'cumulo'), 'section' => $section, 'type' => 'text', 'default' => $default_options['text-font-size']); $options['menu-font'] = array('id' => 'menu-font', 'label' => __('Menu Font', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => $default_options['menu-font']); $options['menu-font-weight'] = array('id' => 'menu-font-weight', 'label' => __('Menu Font Weight', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => cmo_get_font_weights(), 'default' => $default_options['menu-font-weight']); /* background image */ $section = 'content-layout'; $sections[] = array('id' => $section, 'title' => __('Layout', 'cumulo'), 'priority' => '90'); $options['content-preloader'] = array('id' => 'content-preloader', 'label' => __('Preloader', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array('enable' => __('Enable', 'cumulo'), 'disable' => __('Disable', 'cumulo')), 'default' => $default_options['content-preloader']); $options['content-layout'] = array('id' => 'content-layout', 'label' => __('Content Layout', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array('wide' => __('Wide', 'cumulo'), 'boxed' => __('Boxed', 'cumulo')), 'default' => $default_options['content-layout']); $options['content-boxed-width'] = array('id' => 'content-boxed-width', 'label' => __('Boxed Width', 'cumulo'), 'section' => $section, 'type' => 'slider', 'input_attrs' => array('min' => 1200, 'max' => 1400, 'step' => 10), 'default' => $default_options['content-boxed-width'], 'active_callback' => cmo_handle_customizer_dependancy('content-layout', 'boxed')); $options['content-boxed-margin-top-bottom'] = array('id' => 'content-boxed-margin-top-bottom', 'label' => __('Margin Top Bottom', 'cumulo'), 'section' => $section, 'type' => 'text', 'default' => $default_options['content-boxed-margin-top-bottom'], 'active_callback' => cmo_handle_customizer_dependancy('content-layout', 'boxed')); $options['content-background-color'] = array('id' => 'content-background-color', 'label' => __('Background Color in Boxed Layout', 'cumulo'), 'section' => $section, 'type' => 'color', 'default' => $default_options['content-background-color'], 'active_callback' => cmo_handle_customizer_dependancy('content-layout', 'boxed')); $options['content-background-image'] = array('id' => 'content-background-image', 'label' => __('Background Image', 'cumulo'), 'section' => $section, 'type' => 'image', 'default' => $default_options['content-background-image']); $options['content-background-repeat'] = array('id' => 'content-background-repeat', 'label' => __('Background Repeat', 'cumulo'), 'section' => $section, 'type' => 'radio', 'choices' => array('repeat' => __('Tile', 'cumulo'), 'repeat-x' => __('Tile Horizontally', 'cumulo'), 'repeat-y' => __('Tile Vertically', 'cumulo'), 'no-repeat' => __('No Repeat', 'cumulo')), 'default' => $default_options['content-background-repeat'], 'active_callback' => cmo_handle_customizer_dependancy('content-background-image', '', '!=')); $options['content-background-position'] = array('id' => 'content-background-position', 'label' => __('Background Position', 'cumulo'), 'section' => $section, 'type' => 'radio', 'choices' => array('left' => __('Left', 'cumulo'), 'center' => __('Center', 'cumulo'), 'right' => __('Right', 'cumulo')), 'default' => $default_options['content-background-position'], 'active_callback' => cmo_handle_customizer_dependancy('content-background-image', '', '!=')); $options['content-background-attachment'] = array('id' => 'content-background-attachment', 'label' => __('Background Attachment', 'cumulo'), 'section' => $section, 'type' => 'radio', 'choices' => array('scroll' => __('Scroll', 'cumulo'), 'fixed' => __('Fixed', 'cumulo')), 'default' => $default_options['content-background-attachment'], 'active_callback' => cmo_handle_customizer_dependancy('content-background-image', '', '!=')); /* Side bar Options */ $section = 'sidebar'; $sections[] = array('id' => $section, 'title' => __('Sidebar', 'cumulo'), 'priority' => '90', 'description' => __("Select Default sidebar for blogs, portfolios and woocommerce. Sidebar for page needs be specifically set through page option. Sidebar for each posts and portfolios can be overriden through post/portfolio options.", 'cumulo')); $options['sidebar-width'] = array('id' => 'sidebar-width', 'label' => __('Sidebar Width', 'cumulo'), 'section' => $section, 'type' => "slider", 'input_attrs' => array('min' => 25, 'max' => 50, 'step' => 1), 'default' => $default_options['sidebar-width'], 'description' => __("In Percent ( Min: 25%, Max: 50% ). Default is 25%", 'cumulo')); $options['sidebar-sidebar'] = array('id' => 'sidebar-sidebar', 'label' => __('Select Sidebar', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => cmo_get_all_sidebars(__('No Sidebar', 'cumulo')), 'default' => $default_options['sidebar-sidebar']); $options['sidebar-position'] = array('id' => 'sidebar-position', 'label' => __('Sidebar Position', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array("left" => __("Left", 'cumulo'), "right" => __("Right", 'cumulo')), 'default' => $default_options['sidebar-position'], 'active_callback' => cmo_handle_customizer_dependancy('sidebar-sidebar', '0', '!=')); $options['woocommerce-select-sidebar'] = array('id' => 'woocommerce-select-sidebar', 'label' => __('Select Sidebar for Woocommerce', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => cmo_get_all_sidebars(__('No Sidebar', 'cumulo')), 'default' => $default_options['woocommerce-select-sidebar']); $options['woocommerce-sidebar-position'] = array('id' => 'woocommerce-sidebar-position', 'label' => __('Woocommerce Sidebar Position', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array('left' => __('Left', 'cumulo'), 'right' => __('Right', 'cumulo')), 'active_callback' => cmo_handle_customizer_dependancy('woocommerce-select-sidebar', '0', '!=')); /* ------------- */ /* --- Blog Style --- */ $section = 'blog-list'; $sections[] = array('id' => $section, 'title' => __('Blog', 'cumulo'), 'priority' => '90', 'description' => __("Change blog archive page options here. These options will be applied to only archive pages, not pages built with shortcodes.", 'cumulo')); $options['blog-list-style'] = array('id' => 'blog-list-style', 'label' => __('Default Blog List Style', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array("onecolumn" => __("One Column", 'cumulo'), "masonry" => __("Masonry", 'cumulo'), "modern" => __("Modern", 'cumulo')), 'default' => $default_options['blog-list-style']); $options['blog-list-masonry-columns'] = array('id' => 'blog-list-masonry-columns', 'label' => __('Masonry Columns', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array("2" => __("2 Columns", 'cumulo'), "3" => __("3 Columns", 'cumulo'), "4" => __("4 Columns", 'cumulo')), 'default' => $default_options['blog-list-masonry-columns'], 'description' => __('This option will work only with masonry blog list style', 'cumulo'), 'active_callback' => cmo_handle_customizer_dependancy('blog-list-style', 'masonry')); $options['blog-list-modern-full'] = array('id' => 'blog-list-modern-full', 'label' => __('Full width for modern style', 'cumulo'), 'section' => $section, 'type' => 'checkbox', 'default' => $default_options['blog-list-modern-full'], 'description' => __('This option will work only with modern blog list style', 'cumulo'), 'active_callback' => cmo_handle_customizer_dependancy('blog-list-style', 'modern')); $options['blog-list-pagination'] = array('id' => 'blog-list-pagination', 'label' => __('Default Blog List Pagination', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array("classic" => __("Classic", 'cumulo'), "load-more" => __("Load More Button", 'cumulo'), "infinite-scroll" => __("Load On Scroll", 'cumulo')), 'default' => $default_options['blog-list-pagination']); /* --- Blog Style --- */ /* --- Portfolio Options --- */ $section = 'portfolio'; $sections[] = array('id' => $section, 'title' => __('Portfolio', 'cumulo'), 'priority' => '90', 'description' => __("Change portfolio archive/category page options here. These options will be applied to only archive pages, not pages built with shortcodes.", 'cumulo')); $options['portfolio-list-style'] = array('id' => 'portfolio-list-style', 'label' => __('Default Portfolio List Style', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array("grid" => __("Grid", 'cumulo'), "masonry" => __("Masonry", 'cumulo')), 'default' => $default_options['portfolio-list-style']); $options['portfolio-list-full'] = array('id' => 'portfolio-list-full', 'label' => __('Full Width', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array("yes" => __("Yes", 'cumulo'), "no" => __("No", 'cumulo')), 'default' => $default_options['portfolio-list-full'], 'description' => __("Sidebar will not work on full page", 'cumulo')); $options['portfolio-list-columns-grid'] = array('id' => 'portfolio-list-columns-grid', 'label' => __('Columns (Grid Style)', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array('2' => '2', '3' => '3', '4' => '4'), 'default' => $default_options['portfolio-list-columns-grid'], 'active_callback' => cmo_handle_customizer_dependancy('portfolio-list-style', 'grid')); $options['portfolio-list-columns-masonry'] = array('id' => 'portfolio-list-columns-masonry', 'label' => __('Columns (Masonry Style)', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array('2' => '2', '3' => '3', '4' => '4'), 'default' => $default_options['portfolio-list-columns-masonry'], 'active_callback' => cmo_handle_customizer_dependancy('portfolio-list-style', 'masonry')); $options['portfolio-list-margin'] = array('id' => 'portfolio-list-margin', 'label' => __('Margin Between List Items', 'cumulo'), 'section' => $section, 'type' => 'text', 'default' => $default_options['portfolio-list-margin']); $options['portfolio-list-pagination'] = array('id' => 'portfolio-list-pagination', 'label' => __('Default Portfolio List Pagination', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array("classic" => __("Classic", 'cumulo'), "load-more" => __("Load More Button", 'cumulo'), "infinite-scroll" => __("Load On Scroll", 'cumulo')), 'default' => $default_options['portfolio-list-pagination']); $options['portfolio-single-style'] = array('id' => 'portfolio-single-style', 'label' => __('Default Portfolio Single Item Style', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array("style-1" => __("Style 1", 'cumulo'), "style-2" => __("Style 2", 'cumulo'), "style-3" => __("Style 3", 'cumulo'), "style-4" => __("Style 4", 'cumulo')), 'default' => $default_options['portfolio-single-style']); /* --- Portfolio Options --- */ $section = 'woocommerce'; $sections[] = array('id' => $section, 'title' => __('Woocommerce', 'cumulo'), 'priority' => '90', 'description' => __("Select Woocommerce Product List Style", 'cumulo')); $options['woo-list-style'] = array('id' => 'woo-list-style', 'label' => __('Default Woocommerce Product List Style', 'cumulo'), 'section' => $section, 'type' => 'select', 'choices' => array("style-1" => __("Style - 1", 'cumulo'), "style-2" => __("Style - 2", 'cumulo'), "style-3" => __("Style - 3", 'cumulo')), 'default' => $default_options['woo-list-style']); /* --- End of Portfolio Options --- */ /* Custom Code options */ $section = 'custom-code'; $sections[] = array('id' => $section, 'title' => __('Custom Code', 'cumulo'), 'priority' => '90', 'description' => esc_html(__("Enter your custom CSS and JS code here. You can use custom codes to quickly make small changes or put analytics js code. Do not place any <script> or <style> tags as they're already added.", 'cumulo'))); $options['custom-css'] = array('id' => 'custom-css', 'label' => __('Custom CSS', 'cumulo'), 'section' => $section, 'type' => 'textarea', 'default' => $default_options['custom-css']); $options['custom-js'] = array('id' => 'custom-js', 'label' => __('Custom JS', 'cumulo'), 'section' => $section, 'type' => 'textarea', 'default' => $default_options['custom-js']); // Adds the sections to the $options array $options['sections'] = $sections; // Adds the panels to the $options array $options['panels'] = $panels; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); }