/** * Configure settings and controls for the theme customizer * * @since 1.0.0. * * @param object $wp_customize The global customizer object. * @return void */ function customizer_library_register($wp_customize) { $customizer_library = Customizer_Library::Instance(); $options = $customizer_library->get_options(); // Bail early if we don't have any options. if (empty($options)) { return; } // Add the sections if (isset($options['sections'])) { customizer_library_add_sections($options['sections'], $wp_customize); } // Sets the priority for each control added $loop = 0; // Loops through each of the options foreach ($options as $option) { if (isset($option['type'])) { $loop++; // Apply a default sanitization if one isn't set if (!isset($option['sanitize_callback'])) { $option['sanitize_callback'] = customizer_library_get_sanitization($option['type']); } // Add the setting customizer_library_add_setting($option, $wp_customize); // Priority for control if (!isset($option['priority'])) { $option['priority'] = $loop; } // Adds control based on control type switch ($option['type']) { case 'text': case 'select': case 'radio': case 'checkbox': $wp_customize->add_control($option['id'], $option); break; case 'upsell': $wp_customize->add_control(new Customizer_Library_Upsell($wp_customize, $option['id'], $option)); break; case 'color': $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $option['id'], $option)); break; case 'image': $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, $option['id'], array('label' => $option['label'], 'section' => $option['section'], 'sanitize_callback' => $option['sanitize_callback'], 'priority' => $option['priority']))); break; case 'upload': $wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, $option['id'], array('label' => $option['label'], 'section' => $option['section'], 'sanitize_callback' => $option['sanitize_callback'], 'priority' => $option['priority']))); break; case 'textarea': // Custom control required before WordPress 4.0 if (version_compare($GLOBALS['wp_version'], '3.9.2', '<=')) { $wp_customize->add_control(new Customizer_Library_Textarea($wp_customize, $option['id'], $option)); } else { $wp_customize->add_control('setting_id', array($wp_customize->add_control($option['id'], $option))); } break; } } } }
/** * Instantiate or return the one Customizer_Library instance. * * @since 1.0.0. * * @return Customizer_Library */ public static function instance() { if (is_null(self::$instance)) { self::$instance = new self(); } return self::$instance; }
/** * 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(); }
/** * Portfolio Theme Customizer * * @package Portfolio Press */ function portfoliopress_options() { // Stores all the controls that will be added $options = array(); // Stores all the sections to be added $sections = array(); // Logo section $section = 'logo'; $sections[] = array('id' => $section, 'title' => __('Logo Image', 'portfolio-press'), 'priority' => '20'); $options['portfoliopress[logo]'] = array('id' => 'portfoliopress[logo]', 'option_type' => 'option', 'label' => __('Logo', 'portfolio-press'), 'section' => $section, 'type' => 'image', 'default' => ''); $options['portfoliopress[custom_favicon]'] = array('id' => 'portfoliopress[custom_favicon]', 'option_type' => 'option', 'label' => __('Favicon', 'portfolio-press'), 'section' => $section, 'type' => 'image', 'default' => '', 'description' => __('File must be <strong>.png</strong> format. Optimal dimensions: <strong>32px x 32px</strong>.', 'portfolio-press')); $options['portfoliopress[logo_apple_touch]'] = array('id' => 'portfoliopress[logo_apple_touch]', 'option_type' => 'option', 'label' => __('Apple Touch Icon', 'portfolio-press'), 'section' => $section, 'type' => 'image', 'default' => '', 'description' => __('File must be <strong>.png</strong> format. Optimal dimensions: <strong>152px x 152px</strong>.', 'portfolio-press')); // Layout $section = 'layout'; $sections[] = array('id' => $section, 'title' => __('Layout', 'portfolio-press'), 'priority' => '70'); $choices = array('layout-2cr' => __('Sidebar Right', 'portfolio-press'), 'layout-2cl' => __('Sidebar Left', 'portfolio-press'), 'layout-1col' => __('Single Column', 'portfolio-press')); $options['portfoliopress[layout]'] = array('id' => 'portfoliopress[layout]', 'option_type' => 'option', 'label' => __('Standard Layout', 'portfolio-press'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'layout-2cr'); // Colors $section = 'colors'; $sections[] = array('id' => $section, 'title' => __('Colors', 'portfolio-press'), 'priority' => '80'); $options['portfoliopress[header_color]'] = array('id' => 'portfoliopress[header_color]', 'option_type' => 'option', 'label' => __('Header Color', 'portfolio-press'), 'section' => $section, 'type' => 'color', 'default' => '#000000'); // Navigation $section = 'nav'; $choices = array('right' => __('Right of Logo', 'portfolio-press'), 'clear' => __('Underneath Logo', 'portfolio-press')); $options['portfoliopress[menu_position]'] = array('id' => 'portfoliopress[menu_position]', 'option_type' => 'option', 'label' => __('Menu Position', 'portfolio-press'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'right', 'priority' => 100); // Portfolio Settings $section = 'general'; $sections[] = array('id' => $section, 'title' => __('General', 'portfolio-press'), 'priority' => '80'); // Portfolio Post Type Plugin if (class_exists('Portfolio_Post_Type')) { $options['portfoliopress[portfolio_featured_images]'] = array('id' => 'portfoliopress[portfolio_images]', 'option_type' => 'option', 'label' => __('Display Featured Images', 'portfolio-press'), 'description' => __('Display featured images on portfolio posts.', 'portfolio-press'), 'section' => $section, 'type' => 'checkbox', 'default' => '1'); } else { $options['portfoliopress[post_featured_images]'] = array('id' => 'portfoliopress[portfolio_images]', 'option_type' => 'option', 'label' => __('Display Featured Images', 'portfolio-press'), 'description' => __('Display featured images on posts.', 'portfolio-press'), 'section' => $section, 'type' => 'checkbox', 'default' => '1'); } $options['portfoliopress[postnav]'] = array('id' => 'portfoliopress[postnav]', 'option_type' => 'option', 'label' => __('Display post navigation', 'portfolio-press'), 'description' => __('Previous/next links on posts.', 'portfolio-press'), 'section' => $section, 'type' => 'checkbox', 'default' => '0'); // Archive Settings $section = 'archive'; $sections[] = array('id' => $section, 'title' => __('Archive', 'portfolio-press'), 'priority' => '90'); // Portfolio Post Type Plugin if (class_exists('Portfolio_Post_Type')) { $options['portfoliopress[portfolio_archives_fullwidth]'] = array('id' => 'portfoliopress[portfolio_sidebar]', 'option_type' => 'option', 'label' => __('Full Width Archives', 'portfolio-press'), 'description' => __('Display portfolio archives full width.', 'portfolio-press'), 'section' => $section, 'type' => 'checkbox', 'default' => '1'); } else { $options['portfoliopress[post_archives_fullwidth]'] = array('id' => 'portfoliopress[portfolio_sidebar]', 'option_type' => 'option', 'label' => __('Full Width Archives', 'portfolio-press'), 'description' => __('Display image/gallery archives full width.', 'portfolio-press'), 'section' => $section, 'type' => 'checkbox', 'default' => '1'); } $options['portfoliopress[display_image_gallery_post_formats]'] = array('id' => 'portfoliopress[display_image_gallery_post_formats]', 'option_type' => 'option', 'label' => __('Display Image and Gallery Formats on Posts Page', 'portfolio-press'), 'section' => $section, 'type' => 'checkbox', 'default' => '1'); $options['portfoliopress[archive_titles]'] = array('id' => 'portfoliopress[archive_titles]', 'option_type' => 'option', 'label' => __('Archive Titles', 'portfolio-press'), 'description' => __('Display archive titles and descriptions.', 'portfolio-press'), 'section' => $section, 'type' => 'checkbox', 'default' => '1'); // Footer Settings $section = 'footer'; $sections[] = array('id' => $section, 'title' => __('Footer', 'portfolio-press'), 'priority' => '100'); $options['portfoliopress[footer_text]'] = array('id' => 'portfoliopress[footer_text]', 'option_type' => 'option', 'label' => __('Footer Text', 'portfolio-press'), '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); }
/** * Helper function to remove custom theme mods * * @since 1.0.0 * * @param string * @return mixed $default */ function customizer_library_remove_theme_mods() { $customizer_library = Customizer_Library::Instance(); $options = $customizer_library->get_options(); if ($options) { foreach ($options as $option) { if (isset($option['id'])) { remove_theme_mod($option['id']); } } } }
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(); }
/** * Defines customizer options * * @package Customizer_Library */ function customizer_library_gateway_options() { // Theme defaults $primary_color = '#e8554e'; $primary_hover_color = '#db251d'; // Get Categories $options_cats = array(); $options_cats_obj = get_categories('type=post'); $options_cats[''] = 'Select a Category:'; foreach ($options_cats_obj as $cat) { $options_cats[$cat->term_id] = $cat->cat_name; } // Background Image Behavior Options $bg_attachment = array('fixed' => 'Fixed', 'scroll' => 'Scroll'); // 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; // Theme Options Panel $panel = 'theme-options'; $panels[] = array('id' => $panel, 'title' => __('Theme Options', 'demo'), 'priority' => '10'); // Header $section = 'header'; $sections[] = array('id' => $section, 'title' => __('Header', 'gateway'), 'priority' => '10', 'description' => __('Image will display in the header.', 'gateway'), 'panel' => $panel); $options['header_logo'] = array('id' => 'header_logo', 'label' => __('Logo', 'gateway'), 'section' => $section, 'type' => 'image', 'default' => $imagepath . 'logo.png'); $options['header_bg'] = array('id' => 'header_bg', 'label' => __('Inner pages header background', 'gateway'), 'section' => $section, 'type' => 'image', 'default' => $imagepath . 'hero-bg.jpg'); $options['header_color'] = array('id' => 'header_color', 'label' => __('Inner pages header background color.', 'gateway'), 'section' => $section, 'type' => 'color', 'default' => $primary_color, 'transport' => 'postMessage'); // Home $section = 'home'; $sections[] = array('id' => $section, 'title' => __('Home', 'gateway'), 'priority' => '20', 'description' => __('Home Page Options.', 'gateway'), 'panel' => $panel); $options['home_hero_bg'] = array('id' => 'home_hero_bg', 'label' => __('Home Background Image', 'gateway'), 'section' => $section, 'type' => 'image', 'default' => $imagepath . 'hero-bg.jpg', 'active_callback' => 'is_front_page'); $options['bg_attachement'] = array('id' => 'bg_attachement', 'label' => __('Select the behavior of the background image.', 'gateway'), 'section' => $section, 'type' => 'select', 'choices' => $bg_attachment, 'default' => 'fixed', 'active_callback' => 'is_front_page'); $options['home_hero_bg_color'] = array('id' => 'home_hero_bg_color', 'label' => __('Home Hero background color if no image is being used.', 'gateway'), 'section' => $section, 'type' => 'color', 'default' => $primary_color, 'active_callback' => 'is_front_page', 'transport' => 'postMessage'); $options['home_posts_title'] = array('id' => 'home_posts_title', 'label' => __('Enter the home featured posts section title', 'gateway'), 'section' => $section, 'type' => 'text', 'default' => 'Featured Posts', 'active_callback' => 'is_front_page', 'transport' => 'postMessage'); $options['home_posts_subtitle'] = array('id' => 'home_posts_subtitle', 'label' => __('Enter the home featured posts section subtitle', 'gateway'), 'section' => $section, 'type' => 'text', 'default' => 'Occaecati curabitur autem mollit! Vestibulum veritatis. Aliquam orci cumque curabitur.', 'active_callback' => 'is_front_page', 'transport' => 'postMessage'); $options['home_posts_cat'] = array('id' => 'home_posts_cat', 'label' => __('Home Posts Category', 'gateway'), 'section' => $section, 'type' => 'select', 'choices' => $options_cats, 'default' => '', 'active_callback' => 'is_front_page'); // Blog $section = 'blog'; $sections[] = array('id' => $section, 'title' => __('Blog', 'gateway'), 'priority' => '30', 'description' => __('Blog Page Options', 'gateway'), 'panel' => $panel); $options['blog_title'] = array('id' => 'blog_title', 'label' => __('Enter the blog page title', 'gateway'), 'section' => $section, 'type' => 'text', 'default' => 'Blog Page', 'active_callback' => 'is_home', 'transport' => 'postMessage'); $options['blog_subtitle'] = array('id' => 'blog_subtitle', 'label' => __('Enter the blog page subtitle', 'gateway'), 'section' => $section, 'type' => 'text', 'default' => 'Occaecati curabitur autem mollit. Vestibulum veritatis orci.', 'active_callback' => 'is_home', 'transport' => 'postMessage'); // Footer $section = 'footer'; $sections[] = array('id' => $section, 'title' => __('Footer', 'gateway'), 'priority' => '40', 'description' => __('Footer options.', 'gateway'), 'panel' => $panel); $options['footer_copyright'] = array('id' => 'footer_copyright', 'label' => __('Footer copyright text.', 'gateway'), 'section' => $section, 'type' => 'textarea', 'default' => __('Copyright 2014 <a href="#">Rescue Themes</a>. All Rights Reserved.', 'rescue'), 'transport' => 'postMessage'); // Styles $section = 'style'; $sections[] = array('id' => $section, 'title' => __('Style', 'gateway'), 'priority' => '50', 'description' => __('Site wide style options.', 'gateway'), 'panel' => $panel); $options['main_color'] = array('id' => 'main_color', 'label' => __('Main sitewide accent color.', 'gateway'), 'section' => $section, 'type' => 'color', 'default' => $primary_color, 'transport' => 'postMessage'); $options['main_color_hover'] = array('id' => 'main_color_hover', 'label' => __('Main sitewide accent hover color.', 'gateway'), 'section' => $section, 'type' => 'color', 'default' => $primary_hover_color); $upgrade_link = "https://rescuethemes.com/wordpress-themes/gateway-plus/"; /** * Gateway Plus Upgrade Options * */ // Plus: Sidebar $section = 'plus-sidebar'; $sections[] = array('id' => $section, 'title' => __('Layout', 'gateway'), 'priority' => '50', 'description' => '', 'panel' => $panel); $options['layout-plus'] = array('id' => 'layout-plus', 'label' => __('Sidebar Layout', 'gateway'), 'section' => $section, 'type' => 'content', 'input_attrs' => array('content' => __('<p>Adjust the inner sidebar position to display on the right or left side of your content.</p>', 'gateway')), 'description' => sprintf(__('<a target="_blank" href="%1$s">Get access to the sidebar layout option</a>', 'gateway'), esc_url($upgrade_link))); // Plus: Typography $section = 'plus-typography'; $sections[] = array('id' => $section, 'title' => __('Typography', 'gateway'), 'priority' => '50', 'description' => '', 'panel' => $panel); $options['typography-plus'] = array('id' => 'typography-plus', 'label' => __('Advanced Typography Settings', 'gateway'), 'section' => $section, 'type' => 'content', 'input_attrs' => array('content' => __('<p>You\'ll have access to 500+ Google Fonts along with font size, weight, style, transform, line height, and spacing settings for every section:</p><ul><li>Headers and Content</li><li>Navigation</li><li>Sidebar</li><li>Footer</li><li>Copyright</li><li>and more!</li></ul>', 'gateway')), 'description' => sprintf(__('<a target="_blank" href="%1$s">Get access to typography settings</a>', 'gateway'), esc_url($upgrade_link))); // Plus: Colors $section = 'plus-colors'; $sections[] = array('id' => $section, 'title' => __('Colors', 'gateway'), 'priority' => '55', 'description' => '', 'panel' => $panel); $options['colors-plus'] = array('id' => 'colors-plus', 'label' => __('Advanced Color Settings', 'gateway'), 'section' => $section, 'type' => 'content', 'input_attrs' => array('content' => __('<p>Fine tune your site design with an unlimited number of color options for each section of the site:</p><ul><li>Backgrounds</li><li>Navigation</li><li>Links and Fonts</li><li>Footer</li><li>and more!</li></ul>', 'gateway')), 'description' => sprintf(__('<a target="_blank" href="%1$s">Get access to more color settings</a>', 'gateway'), esc_url($upgrade_link))); // Plus: Home Slider $section = 'plus-home-slider'; $sections[] = array('id' => $section, 'title' => __('Home Slider', 'gateway'), 'priority' => '60', 'description' => '', 'panel' => $panel); $options['home-slider-plus'] = array('id' => 'home-slider-plus', 'label' => __('Home Hero Section Slider', 'gateway'), 'section' => $section, 'type' => 'content', 'input_attrs' => array('content' => __('<p>Transform your home hero section from a static background image to a smooth image slider with options to change the slider speed, duration, overlay color, and overlay opacity.</p>', 'gateway')), 'description' => sprintf(__('<a target="_blank" href="%1$s">Get access to the home slider</a>', 'gateway'), esc_url($upgrade_link))); // Plus: WooCommerce $section = 'plus-woocommerce'; $sections[] = array('id' => $section, 'title' => __('eCommerce Shop', 'gateway'), 'priority' => '65', 'description' => '', 'panel' => $panel); $options['woocommerce-plus'] = array('id' => 'woocommerce-plus', 'label' => __('WooCommerce', 'gateway'), 'section' => $section, 'type' => 'content', 'input_attrs' => array('content' => __('<p>Gateway Plus provides compatibility with the world\'s most popular ecommerce system, WooCommerce. Whether it\'s physical products, music files, or your time, it\'s all possible.</p>', 'gateway')), 'description' => sprintf(__('<a target="_blank" href="%1$s">Get access to ecommerce support</a>', 'gateway'), esc_url($upgrade_link))); // Adds the sections panels to the $options array $options['sections'] = $sections; $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 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(); }
/** * 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; // Colors $section = 'colors'; $sections[] = array('id' => $section, 'title' => __('Colors', 'mk'), 'priority' => '40'); $options['primary-color'] = array('id' => 'primary-color', 'label' => __('Link Primary Color', 'mk'), 'section' => $section, 'type' => 'color', 'default' => $primary_color); $options['secondary-color'] = array('id' => 'secondary-color', 'label' => __('Links Hover Color', 'mk'), 'section' => $section, 'type' => 'color', 'default' => $secondary_color); /* $section = 'typography'; $font_choices = customizer_library_get_font_choices(); $sections[] = array( 'id' => $section, 'title' => __( 'Typography', 'mk' ), 'priority' => '35' ); $options['primary-font'] = array( 'id' => 'primary-font', 'label' => __( 'Primary Font', 'mk' ), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Monoton' ); $options['secondary-font'] = array( 'id' => 'secondary-font', 'label' => __( 'Secondary Font', 'mk' ), 'section' => $section, 'type' => 'select', 'choices' => $font_choices, 'default' => 'Merriweather' ); */ $section = 'general'; $sections[] = array('id' => $section, 'title' => __('General Settings', 'mk'), 'priority' => '25'); $options['mk_site_logo'] = array('id' => 'mk_site_logo', 'label' => __('Logo', 'mk'), 'section' => $section, 'type' => 'upload', 'default' => ''); $options['mk_site_favicon'] = array('id' => 'mk_site_favicon', 'label' => __('Favicon', 'mk'), 'section' => $section, 'type' => 'upload', 'default' => ''); $ly = array('classic' => 'Classic', 'grid' => 'Grid'); $options['mk_blog_layout'] = array('id' => 'mk_blog_layout', 'label' => __('Blog Index Layout', 'mk'), 'section' => $section, 'type' => 'select', 'choices' => $ly, 'default' => 'classic'); $options['mk_show_header_search'] = array('id' => 'mk_show_header_search', 'label' => __('Header Search', 'mk'), 'section' => $section, 'type' => 'checkbox', 'default' => 1); $options['mk_show_custom_header_image'] = array('id' => 'mk_show_custom_header_image', 'label' => __('Custom Header Image Section', 'mk'), 'section' => $section, 'type' => 'checkbox', 'default' => 1); // Social Links $slider = 'slider'; $panels[] = array('id' => $slider, 'title' => __('Homepage Slider', 'mk'), 'priority' => '30'); $section = 'slider-section'; $sections[] = array('id' => $section, 'title' => __('Homepage Slider', 'mk'), 'priority' => '10', 'panel' => $slider); /* option group */ $options['mk_show_default_slider'] = array('id' => 'mk_show_default_slider', 'label' => __('Show Default Homepage Slider ', 'mk'), 'section' => $section, 'type' => 'checkbox', 'default' => 1); $options['mk_slide_1_image'] = array('id' => 'mk_slide_1_image', 'label' => __('Slide1 Image', 'mk'), 'section' => $section, 'type' => 'upload', 'default' => get_template_directory_uri() . '/images/slides/slide1.jpg'); $options['mk_slide1_caption'] = array('id' => 'mk_slide1_caption', 'label' => __('Slide1 Main Caption', 'mk'), 'section' => $section, 'type' => 'text', 'default' => __('We are MK Theme', 'mk')); $options['mk_slide1_subcaption'] = array('id' => 'mk_slide1_subcaption', 'label' => __('Slide1 Sub Caption', 'mk'), 'section' => $section, 'type' => 'text', 'default' => __('We make beautiful things happen', 'mk')); $options['mk_slide1_url'] = array('id' => 'mk_slide1_url', 'label' => __('Slide1 Btn URL', 'mk'), 'section' => $section, 'type' => 'url'); $options['mk_slide1_btntext'] = array('id' => 'mk_slide1_btntext', 'label' => __('Slide1 Btn Text', 'mk'), 'section' => $section, 'type' => 'text', 'default' => __('Learn More', 'mk')); /* option group */ $options['mk_slide_2_image'] = array('id' => 'mk_slide_2_image', 'label' => __('Slide2 Image', 'mk'), 'section' => $section, 'type' => 'upload', 'default' => get_template_directory_uri() . '/images/slides/slide2.jpg'); $options['mk_slide2_caption'] = array('id' => 'mk_slide2_caption', 'label' => __('Slide2 Main Caption', 'mk'), 'section' => $section, 'type' => 'text', 'default' => __('Stylish free Wordpress Theme', 'mk')); $options['mk_slide2_subcaption'] = array('id' => 'mk_slide2_subcaption', 'label' => __('Slide2 Sub Caption', 'mk'), 'section' => $section, 'type' => 'text', 'default' => __('Optimized for mobile devices, clean w3C validated markup', 'mk')); $options['mk_slide2_url'] = array('id' => 'mk_slide2_url', 'label' => __('Slide2 Btn URL', 'mk'), 'section' => $section, 'type' => 'url'); $options['mk_slide2_btntext'] = array('id' => 'mk_slide2_btntext', 'label' => __('Slide2 Btn Text', 'mk'), 'section' => $section, 'type' => 'text', 'default' => __('Learn More', 'mk')); /* option group */ $options['mk_slide_3_image'] = array('id' => 'mk_slide_3_image', 'label' => __('Slide3 Image', 'mk'), 'section' => $section, 'type' => 'upload', 'default' => get_template_directory_uri() . '/images/slides/slide3.jpg'); $options['mk_slide3_caption'] = array('id' => 'mk_slide3_caption', 'label' => __('Slide3 Main Caption', 'mk'), 'section' => $section, 'type' => 'text', 'default' => __('Get more with MK <br/>proffessional Version', 'mk')); $options['mk_slide3_subcaption'] = array('id' => 'mk_slide3_subcaption', 'label' => __('Slide3 Sub Caption', 'mk'), 'section' => $section, 'type' => 'text', 'default' => __('Premium sliders, page composer, unlimited layouts...', 'mk')); $options['mk_slide3_url'] = array('id' => 'mk_slide3_url', 'label' => __('Slide3 Btn URL', 'mk'), 'section' => $section, 'type' => 'url'); $options['mk_slide3_btntext'] = array('id' => 'mk_slide3_btntext', 'label' => __('Slide3 Btn Text', 'mk'), 'section' => $section, 'type' => 'text', 'default' => __('Learn More', 'mk')); /* option group */ // Social Links $panel = 'panel'; $panels[] = array('id' => $panel, 'title' => __('Social Links', 'mk'), 'priority' => '30'); $section = 'panel-section'; $sections[] = array('id' => $section, 'title' => __('Social Links', 'mk'), 'priority' => '10', 'panel' => $panel); $options['mk_sl_facebook'] = array('id' => 'mk_sl_facebook', 'label' => __('Facebook URL', 'mk'), 'section' => $section, 'type' => 'url'); $options['mk_sl_twitter'] = array('id' => 'mk_sl_twitter', 'label' => __('Twitter URL', 'mk'), 'section' => $section, 'type' => 'url'); $options['mk_sl_gplus'] = array('id' => 'mk_sl_gplus', 'label' => __('Google Plus URL', 'mk'), 'section' => $section, 'type' => 'url'); $options['mk_sl_pinterest'] = array('id' => 'mk_sl_pinterest', 'label' => __('Pinterest URL', 'mk'), 'section' => $section, 'type' => 'url'); $options['mk_sl_instagram'] = array('id' => 'mk_sl_instagram', 'label' => __('Instagram URL', 'mk'), 'section' => $section, 'type' => 'url'); $options['mk_sl_dribble'] = array('id' => 'mk_sl_dribble', 'label' => __('Dribble URL', 'mk'), 'section' => $section, 'type' => 'url'); // 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_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 */ function politics_customizer_library_options() { // Theme defaults $primary_color = '#5bc08c'; $secondary_color = '#666'; $white = '#fff'; $primary_color_drkblue = '#465a63'; $site_link = "https://rescuethemes.com"; $upgrade_link = "https://rescuethemes.com/wordpress-themes/politics-plus/"; $upgrade_text = __('Upgrade to Politics Plus', 'politics'); // Image path default $imagepath = get_template_directory_uri() . '/img/'; // Get Categories $options_cats = array(); $options_cats_obj = get_categories('type=post'); $options_cats[''] = __('Select a Category', 'politics'); foreach ($options_cats_obj as $cat) { $options_cats[$cat->term_id] = $cat->cat_name; } // 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; /*-------------------------------------------------------------- >>> TABLE OF CONTENTS: ---------------------------------------------------------------- 1.0 Header 2.0 Home 2.1 Home posts 2.2 Secondary Content 2.3 Paralax 2.4 Slider 3.0 Footer 4.0 Blog 5.0 Colors Sitewide 6.0 Plus Upgrade Options --------------------------------------------------------------*/ /*-------------------------------------------------------------- 1.0 Header --------------------------------------------------------------*/ // Header Panel $panel = 'header-panel'; $panels[] = array('id' => $panel, 'title' => __('Header', 'politics'), 'priority' => '6'); $section = 'general'; $sections[] = array('id' => $section, 'title' => __('General', 'politics'), 'priority' => '5', 'description' => __('General header settings', 'politics'), 'panel' => $panel); $options['politics-sticky-header'] = array('id' => 'politics-sticky-header', 'label' => __('Sticky Header', 'politics'), 'section' => $section, 'type' => 'checkbox', 'default' => 0); $section = 'logo'; $sections[] = array('id' => $section, 'title' => __('Logo', 'politics'), 'priority' => '10', 'description' => __('Upload the logo image', 'politics'), 'panel' => $panel); $options['politics-logo'] = array('id' => 'politics-logo', 'label' => __('Logo', 'politics'), 'section' => $section, 'type' => 'image', 'default' => $imagepath . 'logo.png'); $options['politics-logo-height'] = array('id' => 'politics-logo-height', 'label' => __('Logo Height (px or em)', 'politics'), 'section' => $section, 'type' => 'text'); $options['politics-logo-width'] = array('id' => 'politics-logo-width', 'label' => __('Logo Width (px or em)', 'politics'), 'section' => $section, 'type' => 'text', 'default' => '225px'); $section = 'contact'; $sections[] = array('id' => $section, 'title' => __('Contact Details', 'politics'), 'priority' => '10', 'description' => __('Contact details displayed in the top header', 'politics'), 'panel' => $panel); $options['politics-header-phone'] = array('id' => 'politics-header-phone', 'label' => __('Phone Number', 'politics'), 'section' => $section, 'type' => 'textarea', 'default' => __('800 555 1234', 'politics'), 'transport' => 'postMessage'); $options['politics-header-address'] = array('id' => 'politics-header-address', 'label' => __('Location', 'politics'), 'section' => $section, 'type' => 'textarea', 'default' => __('5046 S Greenwood, Chicago USA', 'politics'), 'transport' => 'postMessage'); /*-------------------------------------------------------------- 2.0 Home --------------------------------------------------------------*/ // Home Panel $panel = 'home-panel'; $panels[] = array('id' => $panel, 'title' => __('Home', 'politics'), 'priority' => '10'); /*-------------------------------------------------------------- 2.1 Home Posts --------------------------------------------------------------*/ $section = 'home-featured-posts'; $sections[] = array('id' => $section, 'title' => __('Featured Posts', 'politics'), 'priority' => '15', 'description' => __('Settings for the featured posts section', 'politics'), 'panel' => $panel); $options['home_posts_section_title'] = array('id' => 'home_posts_section_title', 'label' => __('Section Title', 'politics'), 'section' => $section, 'type' => 'textarea', 'default' => __('Latest News', 'politics'), 'transport' => 'postMessage'); $options['home_posts_section_subtitle'] = array('id' => 'home_posts_section_subtitle', 'label' => __('Section Subtitle', 'politics'), 'section' => $section, 'type' => 'textarea', 'default' => __('Change this text in the theme customizer', 'politics'), 'transport' => 'postMessage'); $options['home_posts_cat'] = array('id' => 'home_posts_cat', 'label' => __('Home Posts Category', 'politics'), 'section' => $section, 'type' => 'select', 'choices' => $options_cats); /*-------------------------------------------------------------- 2.2 Secondary Content --------------------------------------------------------------*/ $section = 'home-secondary-content'; $sections[] = array('id' => $section, 'title' => __('Secondary Content', 'politics'), 'priority' => '25', 'description' => __('Settings for the secondary content section on the home page', 'politics'), 'panel' => $panel); $options['home_secondary_content_page'] = array('id' => 'home_secondary_content_page', 'label' => __('Secondary Content Page', 'politics'), 'section' => $section, 'type' => 'dropdown-pages', 'default' => ''); $options['home_secondary_content_title'] = array('id' => 'home_secondary_content_title', 'label' => __('Section Title', 'politics'), 'section' => $section, 'type' => 'textarea', 'default' => __('Community', 'politics'), 'transport' => 'postMessage'); $options['home_secondary_content_subtitle'] = array('id' => 'home_secondary_content_subtitle', 'label' => __('Section Subtitle', 'politics'), 'section' => $section, 'type' => 'textarea', 'default' => __('Change this text in the theme customizer', 'politics'), 'transport' => 'postMessage'); /*-------------------------------------------------------------- 2.3 Parallax Content --------------------------------------------------------------*/ $section = 'home-paralax-content'; $sections[] = array('id' => $section, 'title' => __('Paralax Content', 'politics'), 'priority' => '20', 'description' => __('Settings for the paralax content section on the home page', 'politics'), 'panel' => $panel); $options['home_paralax_content_page'] = array('id' => 'home_paralax_content_page', 'label' => __('Paralax Content Page', 'politics'), 'section' => $section, 'type' => 'dropdown-pages', 'default' => ''); $options['home_paralax_bg'] = array('id' => 'home_paralax_bg', 'label' => __('Background Image', 'politics'), 'section' => $section, 'type' => 'image', 'default' => $imagepath . 'home-paralax.jpg'); $options['home_paralax_bg_color'] = array('id' => 'home_paralax_bg_color', 'label' => __('Background color if no image is being used', 'politics'), 'section' => $section, 'type' => 'color', 'default' => $primary_color_drkblue); /*-------------------------------------------------------------- 2.4 Slider --------------------------------------------------------------*/ /** * Section named 'header_image' so that * add_theme_support( 'custom-header' ) will display in * this section. * * @see politics_backstretch_setup() */ $section = 'header_image'; $sections[] = array('id' => $section, 'title' => __('Hero Slider', 'politics'), 'priority' => '5', 'description' => __('Settings for the home slider.', 'politics'), 'panel' => $panel); $options['home-slider-content-help'] = array('id' => 'home-slider-content-help', 'section' => $section, 'label' => 'Content', 'type' => 'content', 'description' => __('The content area is widgetized. To add content (text, buttons, etc.), add a widget at Widgets > Home Hero', 'politics')); $options['home_duration'] = array('id' => 'home_duration', 'label' => __('Images Duration', 'politics'), 'section' => $section, 'type' => 'range', 'description' => __('Duration time for each background image.', 'politics'), 'default' => 4000, 'input_attrs' => array('min' => 100, 'max' => 10000, 'step' => 100)); $options['home_fade'] = array('id' => 'home_fade', 'label' => __('Image Fade In', 'politics'), 'section' => $section, 'type' => 'range', 'description' => __('Fade in duration for each background image.', 'politics'), 'default' => 1000, 'input_attrs' => array('min' => 100, 'max' => 3000, 'step' => 100)); $options['home_overlay_color'] = array('id' => 'home_overlay_color', 'label' => __('Overlay Color', 'politics'), 'description' => __('Color overlayed on the home page images.', 'politics'), 'section' => $section, 'type' => 'color', 'default' => $primary_color_drkblue); $options['home_opacity'] = array('id' => 'home_opacity', 'label' => __('Opacity level', 'politics'), 'section' => $section, 'type' => 'range', 'description' => __('Adjust the opacity for the overlay color.', 'politics'), 'default' => '0.6', 'input_attrs' => array('min' => 0, 'max' => 1, 'step' => 0.1)); /*-------------------------------------------------------------- 3.0 Footer --------------------------------------------------------------*/ $section = 'footer-section'; $sections[] = array('id' => $section, 'title' => __('Copyright', 'politics'), 'priority' => '30', 'description' => __('Settings for the copyright area', 'politics')); $options['footer_copyright'] = array('id' => 'footer_copyright', 'label' => __('Copyright Text', 'politics'), 'section' => $section, 'type' => 'textarea', 'default' => sprintf(__('Copyright 2015 <a href="%1s">Rescue Themes</a>. All Rights Reserved. Paid for by the campaign.', 'politics'), esc_url($site_link)), 'transport' => 'postMessage'); /*-------------------------------------------------------------- 4.0 Blog --------------------------------------------------------------*/ // Blog Panel $panel = 'blog-panel'; $panels[] = array('id' => $panel, 'title' => __('Blog', 'politics'), 'priority' => '20'); $section = 'blog-layout-section'; $sections[] = array('id' => $section, 'title' => __('Layout', 'politics'), 'priority' => '30', 'description' => __('Settings for the blog page layout', 'politics'), 'panel' => $panel); $choices = array('masonry' => 'Masonry', 'traditional' => 'Traditional'); $options['politics_blog_style'] = array('id' => 'politics_blog_style', 'label' => __('Blog Page Style', 'politics'), 'section' => $section, 'type' => 'select', 'choices' => $choices, 'default' => 'masonry'); $section = 'blog-title-section'; $sections[] = array('id' => $section, 'title' => __('Header', 'politics'), 'priority' => '30', 'description' => __('Settings for the blog page header', 'politics'), 'panel' => $panel); $options['politics_blog_title'] = array('id' => 'politics_blog_title', 'label' => __('Page Title', 'politics'), 'section' => $section, 'type' => 'textarea', 'default' => __('Latest Posts', 'politics'), 'transport' => 'postMessage'); $options['politics_blog_subtitle'] = array('id' => 'politics_blog_subtitle', 'label' => __('Page Subtitle', 'politics'), 'section' => $section, 'type' => 'textarea', 'default' => __('Change this text in the customizer', 'politics'), 'transport' => 'postMessage'); /*-------------------------------------------------------------- 5.0 Colors Sitewide --------------------------------------------------------------*/ $body_font_color = '#78909c'; $header_font_color = '#465a63'; $accent_color = '#ef5350'; $accent_color_dark = '#38474d'; $white = '#FFFFFF'; $section = 'basic-colors'; $sections[] = array('id' => $section, 'title' => __('Basic Colors', 'politics'), 'priority' => '5', 'description' => __('These are the default sitewide colors.', 'politics')); $options['color-headers'] = array('id' => 'color-headers', 'label' => __('Text Headers', 'politics'), 'section' => $section, 'type' => 'color', 'default' => $header_font_color, 'transport' => 'postMessage'); $options['color-content'] = array('id' => 'color-content', 'label' => __('Standard Text', 'politics'), 'section' => $section, 'type' => 'color', 'default' => $body_font_color, 'transport' => 'postMessage'); $options['color-content-link'] = array('id' => 'color-content-link', 'label' => __('Links', 'politics'), 'section' => $section, 'type' => 'color', 'default' => $header_font_color, 'transport' => 'postMessage'); $options['color-content-link-hover'] = array('id' => 'color-content-link-hover', 'label' => __('Link Hover', 'politics'), 'section' => $section, 'type' => 'color', 'default' => $accent_color); $options['color-content-top-bar'] = array('id' => 'color-content-top-bar', 'label' => __('Top Bar Background', 'politics'), 'section' => $section, 'type' => 'color', 'default' => $accent_color_dark, 'transport' => 'postMessage'); $options['color-content-body-bg'] = array('id' => 'color-content-body-bg', 'label' => __('Sitewide Background', 'politics'), 'section' => $section, 'type' => 'color', 'default' => $white, 'transport' => 'postMessage'); $options['advanced-colors'] = array('id' => 'advanced-colors', 'label' => __('Advanced Colors', 'politics'), 'section' => $section, 'type' => 'content', 'content' => __('<p>Fine tune your site design with an unlimited number of color options for each section of the site:</p><ul><li>Backgrounds</li><li>Navigation</li><li>Links and Fonts</li><li>Footer</li><li>and more!</li></ul>', 'politics'), 'description' => sprintf('<a class="upgrade-link" target="_blank" href="%1s">%2s →</a>', esc_url($upgrade_link), esc_attr($upgrade_text))); /*-------------------------------------------------------------- 6.0 Plus Upgrade Options --------------------------------------------------------------*/ // Plus: Home Control $section = 'plus-home-control'; $sections[] = array('id' => $section, 'title' => __('Upgrade Available', 'politics'), 'priority' => '50', 'description' => ''); $options['home-controls-plus'] = array('id' => 'home-controls-plus', 'label' => __('Home Sections', 'politics'), 'section' => $section, 'type' => 'content', 'content' => sprintf(__('<p>Take control of your home page content sections with the abilitiy to re-order and toggle sections on/off.</p><img src="%s">', 'politics'), $imagepath . 'home-controls.png')); $options['typography-plus'] = array('id' => 'typography-plus', 'label' => __('Advanced Typography Settings', 'politics'), 'section' => $section, 'type' => 'content', 'content' => __('<p>You\'ll have access to 500+ Google Fonts along with font size, weight, style, transform, line height, and spacing settings for every part of your site!</p><ul><li>Headers and Content</li><li>Navigation</li><li>Sidebar</li><li>Footer</li><li>Copyright</li><li>and more!</li></ul>', 'politics')); $options['colors-plus'] = array('id' => 'colors-plus', 'label' => __('Advanced Color Settings', 'politics'), 'section' => $section, 'type' => 'content', 'content' => __('<p>Fine tune your site design with an unlimited number of color options for each section of the site:</p><ul><li>Backgrounds</li><li>Navigation</li><li>Links and Fonts</li><li>Footer</li><li>and more!</li></ul>', 'politics')); $options['plus-sidebar-notice'] = array('id' => 'plus-sidebar-notice', 'label' => __('Sidebar Layout', 'politics'), 'section' => $section, 'type' => 'content', 'content' => sprintf(__('<p>Adjust the inner sidebar position to display on the right or left side of your content.</p>', 'politics'))); $options['plus-woocommerce-notice'] = array('id' => 'plus-woocommerce-notice', 'label' => __('WooCommerce', 'politics'), 'section' => $section, 'type' => 'content', 'content' => __('<p>Politics Plus includes compatibility with the world\'s most popular ecommerce system, WooCommerce. Sell physical products, music files, or even your time when you upgrade!</p>', 'politics'), 'description' => sprintf('<a class="upgrade-link" target="_blank" href="%1s">%2s →</a>', esc_url($upgrade_link), esc_attr($upgrade_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 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); }
/** * 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(); }
/** * 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(); }
/** * Configure settings and controls for the theme customizer * * @since 1.0.0. * * @param object $wp_customize The global customizer object. * @return void */ function customizer_library_register($wp_customize) { $customizer_library = Customizer_Library::Instance(); $options = $customizer_library->get_options(); //* Bail early if we don't have any options. if (empty($options)) { return; } $sections = $options['sections']; if (isset($sections)) { foreach ($sections as $section) { if (!isset($section['description'])) { $section['description'] = false; } $wp_customize->add_section($section['id'], $section); } } $loop = 0; foreach ($options as $option) { if (isset($option['type'])) { $loop++; // Default for setting if (isset($option['default'])) { $default = array('default' => $option['default']); } // Priority for control if (!isset($option['priority'])) { $option['priority'] = $loop; } $wp_customize->add_setting($option['id'], $default); switch ($option['type']) { case 'select': if (!isset($option['sanitize_callback'])) { $option['sanitize_callback'] = 'customizer_library_sanitize_choices'; } $wp_customize->add_control($option['id'], $option); break; /** * @todo combine with 'select' */ /** * @todo combine with 'select' */ case 'radio': if (!isset($option['sanitize_callback'])) { $option['sanitize_callback'] = 'customizer_library_sanitize_choices'; } $wp_customize->add_control($option['id'], $option); break; case 'checkbox': if (!isset($option['sanitize_callback'])) { $option['sanitize_callback'] = 'customizer_library_sanitize_checkbox'; } $wp_customize->add_control($option['id'], $option); break; case 'color': if (!isset($option['sanitize_callback'])) { $option['sanitize_callback'] = 'sanitize_hex_color'; } $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $option['id'], $option)); break; case 'image': if (!isset($option['sanitize_callback'])) { $option['sanitize_callback'] = 'customizer_library_sanitize_file_url'; } $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, $option['id'], array('label' => $option['label'], 'section' => $option['section'], 'sanitize_callback' => $option['sanitize_callback'], 'priority' => $option['priority']))); break; case 'upload': if (!isset($option['sanitize_callback'])) { $option['sanitize_callback'] = 'customizer_library_sanitize_file_url'; } $wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, $option['id'], array('label' => $option['label'], 'section' => $option['section'], 'sanitize_callback' => $option['sanitize_callback'], 'priority' => $option['priority']))); break; case 'textarea': if (!isset($option['sanitize_callback'])) { $option['sanitize_callback'] = 'customizer_library_sanitize_text'; } // Custom control required before WordPress 4.0 if (version_compare($GLOBALS['wp_version'], '3.9.2', '<=')) { $wp_customize->add_control(new Customizer_Library_Textarea($wp_customize, $option['id'], $option)); } else { $wp_customize->add_control('setting_id', array($wp_customize->add_control($option['id'], $option))); } break; } } } }
/** * 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 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(); }
/** * Defines customizer options * * @package Customizer_Library */ function customizer_library_gateway_options() { // Theme defaults $primary_color = '#e8554e'; $primary_hover_color = '#db251d'; // Get Categories $options_cats = array(); $options_cats_obj = get_categories('type=post'); $options_cats[''] = 'Select a Category:'; foreach ($options_cats_obj as $cat) { $options_cats[$cat->term_id] = $cat->cat_name; } // Background Image Behavior Options $bg_attachment = array('fixed' => 'Fixed', 'scroll' => 'Scroll'); // 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; // Theme Options Panel $panel = 'theme-options'; $panels[] = array('id' => $panel, 'title' => __('Theme Options', 'demo'), 'priority' => '10'); // Header $section = 'header'; $sections[] = array('id' => $section, 'title' => __('Header', 'gateway'), 'priority' => '10', 'description' => __('Image will display in the header.', 'gateway'), 'panel' => $panel); $options['header_logo'] = array('id' => 'header_logo', 'label' => __('Logo', 'gateway'), 'section' => $section, 'type' => 'image', 'default' => $imagepath . 'logo.png'); $options['header_bg'] = array('id' => 'header_bg', 'label' => __('Inner pages header background', 'gateway'), 'section' => $section, 'type' => 'image', 'default' => $imagepath . 'hero-bg.jpg'); $options['header_color'] = array('id' => 'header_color', 'label' => __('Inner pages header background color.', 'gateway'), 'section' => $section, 'type' => 'color', 'default' => $primary_color, 'transport' => 'postMessage'); // Home $section = 'home'; $sections[] = array('id' => $section, 'title' => __('Home', 'gateway'), 'priority' => '20', 'description' => __('Home Page Options.', 'gateway'), 'panel' => $panel); $options['home_hero_bg'] = array('id' => 'home_hero_bg', 'label' => __('Home Background Image', 'gateway'), 'section' => $section, 'type' => 'image', 'default' => $imagepath . 'hero-bg.jpg', 'active_callback' => 'is_front_page'); $options['bg_attachement'] = array('id' => 'bg_attachement', 'label' => __('Select the behavior of the background image.', 'gateway'), 'section' => $section, 'type' => 'select', 'choices' => $bg_attachment, 'default' => 'fixed', 'active_callback' => 'is_front_page'); $options['home_hero_bg_color'] = array('id' => 'home_hero_bg_color', 'label' => __('Home Hero background color if no image is being used.', 'gateway'), 'section' => $section, 'type' => 'color', 'default' => $primary_color, 'active_callback' => 'is_front_page', 'transport' => 'postMessage'); $options['home_posts_title'] = array('id' => 'home_posts_title', 'label' => __('Enter the home featured posts section title', 'gateway'), 'section' => $section, 'type' => 'text', 'default' => 'Featured Posts', 'active_callback' => 'is_front_page', 'transport' => 'postMessage'); $options['home_posts_subtitle'] = array('id' => 'home_posts_subtitle', 'label' => __('Enter the home featured posts section subtitle', 'gateway'), 'section' => $section, 'type' => 'text', 'default' => 'Occaecati curabitur autem mollit! Vestibulum veritatis. Aliquam orci cumque curabitur.', 'active_callback' => 'is_front_page', 'transport' => 'postMessage'); $options['home_posts_cat'] = array('id' => 'home_posts_cat', 'label' => __('Home Posts Category', 'gateway'), 'section' => $section, 'type' => 'select', 'choices' => $options_cats, 'default' => '', 'active_callback' => 'is_front_page'); // Blog $section = 'blog'; $sections[] = array('id' => $section, 'title' => __('Blog', 'gateway'), 'priority' => '30', 'description' => __('Blog Page Options', 'gateway'), 'panel' => $panel); $options['blog_title'] = array('id' => 'blog_title', 'label' => __('Enter the blog page title', 'gateway'), 'section' => $section, 'type' => 'text', 'default' => 'Blog Page', 'active_callback' => 'is_home', 'transport' => 'postMessage'); $options['blog_subtitle'] = array('id' => 'blog_subtitle', 'label' => __('Enter the blog page subtitle', 'gateway'), 'section' => $section, 'type' => 'text', 'default' => 'Occaecati curabitur autem mollit. Vestibulum veritatis orci.', 'active_callback' => 'is_home', 'transport' => 'postMessage'); // Footer $section = 'footer'; $sections[] = array('id' => $section, 'title' => __('Footer', 'gateway'), 'priority' => '40', 'description' => __('Footer options.', 'gateway'), 'panel' => $panel); $options['footer_copyright'] = array('id' => 'footer_copyright', 'label' => __('Footer copyright text.', 'gateway'), 'section' => $section, 'type' => 'textarea', 'default' => __('Copyright 2014 <a href="#">Rescue Themes</a>. All Rights Reserved.', 'rescue'), 'transport' => 'postMessage'); // Styles $section = 'style'; $sections[] = array('id' => $section, 'title' => __('Style', 'gateway'), 'priority' => '50', 'description' => __('Site wide style options.', 'gateway'), 'panel' => $panel); $options['main_color'] = array('id' => 'main_color', 'label' => __('Main sitewide accent color.', 'gateway'), 'section' => $section, 'type' => 'color', 'default' => $primary_color, 'transport' => 'postMessage'); $options['main_color_hover'] = array('id' => 'main_color_hover', 'label' => __('Main sitewide accent hover color.', 'gateway'), 'section' => $section, 'type' => 'color', 'default' => $primary_hover_color); // Adds the sections panels to the $options array $options['sections'] = $sections; $options['panels'] = $panels; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options($options); // To delete custom mods use: customizer_library_remove_theme_mods(); }