예제 #1
0
function ciDisplayFontCustomizationOptions($wp_customize)
{
    require_once "FontOptionsBuilder.php";
    $fontOptions = new FontOptionsBuilder();
    $openSansDefaultVariants = array('300italic' => '1', '400italic' => '1', '700italic' => '1', '400' => '1', '300' => '1', '700' => '1');
    $titleFontOptions = array($fontOptions->getFontFamilySelect('title_font_family', "Bree+Serif"), $fontOptions->getFontFamilyVariants('title_font_variants'), $fontOptions->getWeightOption('title_font_weight', '400'), $fontOptions->getFallbackOption('title_font_fallback', 'Georgia, Garamond, sans-serif'));
    $headingFontOptions = array($fontOptions->getFontFamilySelect('heading_font_family', "Bree+Serif"), $fontOptions->getFontFamilyVariants('heading_font_variants'), $fontOptions->getWeightOption('heading_font_weight', '400'), $fontOptions->getFallbackOption('body_font_fallback', 'Georgia, Garamond, sans-serif'));
    $bodyFontOptions = array($fontOptions->getFontFamilySelect('body_font_family', "Open+Sans"), $fontOptions->getFontFamilyVariants('body_font_variants', $openSansDefaultVariants), $fontOptions->getWeightOption('body_font_weight', '400'), $fontOptions->getFallbackOption('body_font_fallback', '"Helvetica Neue", Helvetica, Arial, sans-serif'));
    $widgetFontOptions = array($fontOptions->getFontFamilySelect('widget_title_font_family', "Open+Sans"), $fontOptions->getFontFamilyVariants('widget_title_font_variants', $openSansDefaultVariants), $fontOptions->getWeightOption('widget_title_font_weight', '700'), $fontOptions->getFallbackOption('widget_title_font_fallback', '"Helvetica Neue", Helvetica, Arial, sans-serif'));
    $menuFontOptions = array($fontOptions->getFontFamilySelect('menu_font_family', "Open+Sans"), $fontOptions->getFontFamilyVariants('menu_font_variants', $openSansDefaultVariants), $fontOptions->getWeightOption('menu_font_weight', '700'), $fontOptions->getFallbackOption('menu_font_fallback', '"Helvetica Neue", Helvetica, Arial, sans-serif'));
    $wp_customize->add_panel('fonts', array('title' => __('Fonts', 'ci-modern-accounting-firm'), 'description' => __('<p>Here, you can use just about any font you find in the <a href="http://www.google.com/fonts/" target="_blank">Google Fonts directory</a>.</p><p><strong>NOTE</strong>: It is recommended that you use a maximum of two to three fonts. More fonts will slow down page loads and generally look less professional.</p>', 'ci-modern-accounting-firm'), 'priority' => 40));
    $wp_customize->add_section('fonts-titles', array('title' => __('Page Title (H1) Font', 'ci-modern-accounting-firm'), 'panel' => 'fonts'));
    ciAddCustomizationsToSection($wp_customize, $titleFontOptions, 'fonts-titles');
    $wp_customize->add_section('fonts-headings', array('title' => __('Headings (H2, H3, H4) Font', 'ci-modern-accounting-firm'), 'panel' => 'fonts'));
    ciAddCustomizationsToSection($wp_customize, $headingFontOptions, 'fonts-headings');
    $wp_customize->add_section('fonts-body', array('title' => __('Body Font', 'ci-modern-accounting-firm'), 'panel' => 'fonts'));
    ciAddCustomizationsToSection($wp_customize, $bodyFontOptions, 'fonts-body');
    $wp_customize->add_section('fonts-widgets', array('title' => __('Widget Title Font', 'ci-modern-accounting-firm'), 'panel' => 'fonts'));
    ciAddCustomizationsToSection($wp_customize, $widgetFontOptions, 'fonts-widgets');
    $wp_customize->add_section('fonts-menu', array('title' => __('Menu Font', 'ci-modern-accounting-firm'), 'panel' => 'fonts'));
    ciAddCustomizationsToSection($wp_customize, $menuFontOptions, 'fonts-menu');
}
예제 #2
0
function ciCustomizeRegister($wp_customize)
{
    $defaultColors = ciGetColorTheme();
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // PAGE SETUP
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $patternPath = get_template_directory_uri() . '/assets/img/patterns/';
    $subtlePatterns = array('none' => $patternPath . 'none.png', 'dark_wood' => $patternPath . 'dark_wood.png', 'tileable_wood_texture' => $patternPath . 'tileable_wood_texture.png', 'wood_1' => $patternPath . 'wood_1.png', 'wood_pattern' => $patternPath . 'wood_pattern.png', 'brushed_@2X' => $patternPath . '*****@*****.**', 'grey_wash_wall' => $patternPath . 'grey_wash_wall.jpg', 'light_grey' => $patternPath . 'light_grey.png', 'nice_snow' => $patternPath . 'nice_snow.png', 'ricepaper_v3' => $patternPath . 'ricepaper_v3.png', 'sandpaper' => $patternPath . 'sandpaper.png', 'sos' => $patternPath . 'sos.png', 'stardust_@2X' => $patternPath . '*****@*****.**', 'ticks_@2X' => $patternPath . '*****@*****.**', 'tweed_@2X' => $patternPath . '*****@*****.**', 'witewall_3_@2X' => $patternPath . '*****@*****.**');
    $pageSetupOptions = array(ciGetFullWidthContainerOption(), array('slug' => 'full_screen_image_bg', 'type' => 'image', 'label' => __('Full-Screen Background Image', 'ci-modern-doctors-office')), array('label' => __("Body Background Pattern", 'ci-modern-doctors-office'), 'description' => __("To use a subtle pattern (from subtlepatterns.com) as the background to the pages (instead of a flat, solid color or an image), select a pattern here.", 'ci-modern-doctors-office'), 'slug' => "pattern_bg", 'default' => "none", 'type' => "radio-images", 'options' => $subtlePatterns), array('label' => __('Enable demo mode?', 'ci-modern-doctors-office'), 'description' => __('If checked, we will display the theme selector on every page. You probably do not want to do this.', 'ci-modern-doctors-office'), 'slug' => 'mlf_demo_site', 'default' => false, 'type' => 'checkbox'));
    $wp_customize->add_section('page_setup', array('title' => __('Page Setup', 'ci-modern-doctors-office'), 'priority' => 0));
    ciAddCustomizationsToSection($wp_customize, $pageSetupOptions, 'page_setup');
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // HEADER
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $headerOption = array(array('slug' => 'social_in_nav', 'default' => false, 'label' => __('Show social media icons to the right of the nav bar?', 'ci-modern-doctors-office'), 'type' => 'checkbox'), array('slug' => 'search_in_nav', 'default' => true, 'label' => __('Show search box to the right of the nav bar?', 'ci-modern-doctors-office'), 'type' => 'checkbox'), array('label' => __('Additional "menu" text', 'ci-modern-doctors-office'), 'description' => __('This will appear to the far right of the navigation menu. Example: Call us at (123) 456-7890', 'ci-modern-doctors-office'), 'slug' => 'additional_menu_text', 'type' => 'text'), array('slug' => 'navbar_fixed', 'default' => false, 'label' => __('Fix navigation bar to top of screen?', 'ci-modern-doctors-office'), 'type' => 'checkbox'), array('slug' => 'header_link_size', 'default' => '100', 'label' => __('Nav Menu Text Size (percent)', 'ci-modern-doctors-office'), 'type' => 'text'), array('slug' => 'company_logo', 'label' => __('Company Logo', 'ci-modern-doctors-office'), 'type' => 'image'), array('slug' => 'svg_logo', 'label' => __('Company Logo (SVG Version, used only on supported browsers)', 'ci-modern-doctors-office'), 'type' => 'image'), array('slug' => 'logo_width', 'default' => '', 'label' => __('Width to display logo (px)', 'ci-modern-doctors-office'), 'type' => 'text'), array('slug' => 'logo_height', 'default' => '', 'label' => __('Height to display logo (px)', 'ci-modern-doctors-office'), 'type' => 'text'), array('slug' => 'logo_top_padding', 'default' => '24', 'label' => __('Top padding for logo (px)', 'ci-modern-doctors-office'), 'type' => 'text'));
    $wp_customize->add_section('header', array('title' => __('Header', 'ci-modern-doctors-office'), 'description' => __('Configure your logo, the navigation menu, and other items in the site-wide header.', 'ci-modern-doctors-office'), 'priority' => 0));
    ciAddCustomizationsToSection($wp_customize, $headerOption, 'header');
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // BODY COLORS
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $colors = array(ciGetColorThemeOption(), array('type' => 'heading', 'slug' => 'body_colors_heading', 'label' => __('Body Colors', 'ci-modern-doctors-office')), array('slug' => 'splash_color', 'default' => $defaultColors['splash_color'], 'type' => 'color', 'label' => __('Link Color', 'ci-modern-doctors-office')), array('slug' => 'button_color', 'default' => $defaultColors['button_color'], 'type' => 'color', 'label' => __('Button Color', 'ci-modern-doctors-office')), array('slug' => 'page_title_color', 'default' => $defaultColors['page_title_color'], 'type' => 'color', 'label' => __('Page Title Color', 'ci-modern-doctors-office')), array('slug' => 'heading_color', 'default' => $defaultColors['heading_color'], 'type' => 'color', 'label' => __('Level 2 Heading Color', 'ci-modern-doctors-office')), array('slug' => 'background_color', 'default' => $defaultColors['background_color'], 'type' => 'color', 'label' => __('Background Color', 'ci-modern-doctors-office')), array('slug' => 'secondary_background_color', 'default' => $defaultColors['secondary_background_color'], 'type' => 'color', 'label' => __('Secondary Background Color', 'ci-modern-doctors-office')), array('slug' => 'copyright_text_color', 'default' => '#333333', 'label' => __('Footer copyright notice text color', 'ci-modern-doctors-office'), 'type' => 'color'), array('type' => 'line', 'slug' => 'body_colors_post_line'), array('type' => 'heading', 'slug' => 'header_colors_heading', 'label' => __('Header Colors', 'ci-modern-doctors-office')), array('slug' => 'firm_name_color', 'default' => $defaultColors['firm_name_color'], 'label' => __('Company Name Color', 'ci-modern-doctors-office'), 'type' => 'color'), array('slug' => 'header_text_color', 'default' => $defaultColors['header_text_color'], 'label' => __('Nav Menu Text Color', 'ci-modern-doctors-office'), 'type' => 'color'), array('slug' => 'header_highlight_color', 'default' => $defaultColors['header_highlight_color'], 'label' => __('Nav Menu Highlight ("You Are Here") Color', 'ci-modern-doctors-office'), 'type' => 'color'), array('slug' => 'header_hover_color', 'default' => $defaultColors['header_hover_color'], 'label' => __('Nav Menu Hover Color', 'ci-modern-doctors-office'), 'type' => 'color'), array('slug' => 'header_bg_color', 'default' => $defaultColors['header_bg_color'], 'label' => __('Nav Menu Background Color', 'ci-modern-doctors-office'), 'type' => 'color'), array('slug' => 'header_link_bg_is_solid', 'default' => false, 'label' => __('Active Menu Item Has Solid Background?', 'ci-modern-doctors-office'), 'type' => 'checkbox'), array('type' => 'line', 'slug' => 'header_colors_post_line'), array('type' => 'heading', 'slug' => 'fancy_landing_page_colors_heading', 'label' => __('Fancy Landing Page Colors', 'ci-modern-doctors-office')), array('slug' => 'fancy_landing_text_color', 'default' => "#ffffff", 'type' => 'color', 'label' => __('Text Color', 'ci-modern-doctors-office')), array('slug' => 'fancy_landing_splash_color', 'default' => $defaultColors['splash_color'], 'type' => 'color', 'label' => __('Highlight Color', 'ci-modern-doctors-office')), array('slug' => 'fancy_landing_page_title_color', 'default' => $defaultColors['page_title_color'], 'type' => 'color', 'label' => __('Page Title Color', 'ci-modern-doctors-office')), array('slug' => 'fancy_landing_heading_color', 'default' => "#ffffff", 'type' => 'color', 'label' => __('Other Headings Color', 'ci-modern-doctors-office')));
    // We use the default Colors section
    ciAddCustomizationsToSection($wp_customize, $colors, 'colors');
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // FONTS
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ciDisplayFontCustomizationOptions($wp_customize);
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // FOOTER
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $footerOptions = array(array('slug' => 'footer_columns', 'default' => '4', 'label' => __('Footer Columns (1-4)', 'ci-modern-doctors-office'), 'description' => __('We place each widget in the Footer widget area in its own column; in general, you want this number to match the number of widgets you place in the Footer widget area.', 'ci-modern-doctors-office'), 'type' => 'text'), array('label' => __('Footer text (for the bottom of each page)', 'ci-modern-doctors-office'), 'description' => "If you'd like text at the very, very bottom of each page, you can type it here.", 'slug' => 'disclaimer', 'type' => 'textarea'), array('label' => __('Copyright Text', 'ci-modern-doctors-office'), 'description' => __('Appears beneath the footer text, if applicable', 'ci-modern-doctors-office'), 'slug' => 'copyright', 'default' => '&copy; ' . date('Y') . ' ' . do_shortcode(get_bloginfo('name')), 'type' => 'text'), array('label' => __('Enable theme design attribution?', 'ci-modern-doctors-office'), 'description' => __('If checked, enables a brief credit line for the theme\'s creators', 'ci-modern-doctors-office'), 'slug' => 'enable_attribution', 'default' => 1, 'type' => 'checkbox'));
    $wp_customize->add_section('footer', array('title' => __('Footer', 'ci-modern-doctors-office'), 'priority' => 100));
    ciAddCustomizationsToSection($wp_customize, $footerOptions, 'footer');
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // SOCIAL MEDIA LINKS
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $socialMediaOptions = ciGetSocialCustomizationOptions();
    $wp_customize->add_section('social_media', array('title' => __('Social Media Links', 'ci-modern-doctors-office'), 'priority' => 100));
    ciAddCustomizationsToSection($wp_customize, $socialMediaOptions, 'social_media');
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // FAVICON
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $faviconOptions = array(array('slug' => 'favicon', 'label' => __('Favicon for site', 'ci-modern-doctors-office'), 'description' => __('A <a href="http://en.wikipedia.org/wiki/Favicon" target="_blank">favicon</a> is the little icon displayed in the page\'s tab. You can create one from a 16&times;16 image using the <a href="http://www.favicon.cc/" target="_blank">Favicon Generator</a>.', 'ci-modern-doctors-office'), 'type' => 'image'), array('label' => __('Apple Touch Icon', 'ci-modern-doctors-office'), 'description' => __('When someone adds your site to their home screen on an Apple device (iPhone, iPad, etc.), the <a href="https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html" target="_blank">Apple Touch Icon</a> is the image that will be used. (Typically, a 152&times;152 PNG is recommended.)', 'ci-modern-doctors-office'), 'slug' => 'touch_icon', 'type' => 'image'), array('slug' => 'touch_icon_precomposed', 'default' => false, 'label' => __('Disable added effects on Apple Touch Icon?', 'ci-modern-doctors-office'), 'description' => __('Disables the curved border, drop shadow, etc. for Apple touch icon', 'ci-modern-doctors-office'), 'type' => 'checkbox'));
    $wp_customize->add_section('favicon', array('title' => __('Favicon', 'ci-modern-doctors-office')));
    ciAddCustomizationsToSection($wp_customize, $faviconOptions, 'favicon');
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // CUSTOM CSS
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $cssOptions = array(array('slug' => 'custom_css', 'default' => '', 'label' => __('Custom CSS', 'ci-modern-doctors-office'), 'description' => __('If you <em>really</em> don\'t want to create a child theme, you can add custom CSS to the header here.', 'ci-modern-doctors-office'), 'type' => 'textarea'));
    $wp_customize->add_section('custom_css', array('title' => __('Custom CSS', 'ci-modern-doctors-office')));
    ciAddCustomizationsToSection($wp_customize, $cssOptions, 'custom_css');
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // GOOGLE ANALYTICS
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $analyticsOptions = array(array('slug' => 'analytics_id', 'default' => '', 'label' => __('Google Analytics ID', 'ci-modern-doctors-office'), 'description' => __('Format: <code>UA-XXXXX-Y</code> (Note: Universal Analytics only, not Classic Analytics). Note that Analytics tracking will <em>not</em> be active when you are logged in. (Open a different Web browser to test it.)', 'ci-modern-doctors-office'), 'type' => 'text'));
    $wp_customize->add_section('analytics', array('title' => __('Google Analytics', 'ci-modern-doctors-office')));
    ciAddCustomizationsToSection($wp_customize, $analyticsOptions, 'analytics');
}
예제 #3
0
function ciDisplayFontCustomizationOptions($wp_customize)
{
    $fontOptions = array(array('type' => 'info', 'slug' => 'fonts_upgrade_msg', 'description' => sprintf(__('<strong>Note:</strong> The ability to use 600+ free <a href="https://www.google.com/fonts" target="_blank">Google Fonts</a> are a feature of <a href="%1$s">the premium version</a> of this theme. You can upgrade (without losing any of your existing work!) for $55 <a href="%1$s">on the Conversion Insights Web site</a>.', 'ci-modern-doctors-office'), CI_THEME_BUY_URL)));
    $wp_customize->add_section('fonts-upgrade', array('title' => __('Fonts', 'ci-modern-doctors-office')));
    ciAddCustomizationsToSection($wp_customize, $fontOptions, 'fonts-upgrade');
}