add_section( 'colors' , array(
'title' => esc_html__( 'Color Scheme', 'mnmlwp' ),
'priority' => 30,
) );
$wp_customize->add_section( 'mnmlwp_layout_section' , array(
'title' => esc_html__( 'Page Layout', 'mnmlwp' ),
'priority' => 30,
) );
$wp_customize->add_section( 'mnmlwp_hero_section' , array(
'title' => esc_html__( 'Hero Section', 'mnmlwp' ),
'priority' => 30,
) );
// Section Settings Color Scheme
// General
$wp_customize->add_setting( 'mnmlwp_body_text_color' , array(
'default' => '#333333',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_headings_text_color' , array(
'default' => '#333333',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_link_color' , array(
'default' => '#444bb1',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_link_hover_color' , array(
'default' => '#33398c',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
// Header
$wp_customize->add_setting( 'mnmlwp_has_logo_and_title' , array(
'default' => 0,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_logo_height_desktop' , array(
'default' => 2,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_logo_height_tablet' , array(
'default' => 2,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_logo_height_mobile' , array(
'default' => 2,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_logo_base_font_size_desktop' , array(
'default' => 1.75,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_logo_base_font_size_tablet' , array(
'default' => 1.75,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_logo_base_font_size_mobile' , array(
'default' => 1.5,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_site_title_font_size' , array(
'default' => 1,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_site_subtitle_font_size' , array(
'default' => 0.5875,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_header_bg_color' , array(
'default' => '#222222',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_logo_text_color' , array(
'default' => '#ffffff',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_logo_icon_color' , array(
'default' => '#444bb1',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_tagline_color' , array(
'default' => '#b5b5b5',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_logo_icon' , array(
'default' => 'superpowers',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_contact_row_bg_color' , array(
'default' => '#124239',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_contact_row_text_color' , array(
'default' => '#ffffff',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_contact_row', array(
'capability' => 'edit_theme_options',
'default' =>'Hey, this is the mnmlWP contact row! 😊',
'sanitize_callback' => 'wp_kses_post',
) );
// Breadcrumb navigation
if( function_exists('breadcrumb_trail') ):
$wp_customize->add_setting( 'mnmlwp_breadcrumb_bg_color' , array(
'default' => '#ffffff',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_breadcrumb_text_color' , array(
'default' => '#333333',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_breadcrumb_link_color' , array(
'default' => '#444bb1',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_breadcrumb_link_hover_color' , array(
'default' => '#33398c',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
endif;
// Navigation
$wp_customize->add_setting( 'mnmlwp_nav_row_color' , array(
'default' => '#444bb1',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_nav_link_color' , array(
'default' => '#ffffff',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_nav_link_background_color' , array(
'default' => '#444bb1',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_nav_link_color_hover' , array(
'default' => '#ffffff',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_nav_link_background_color_hover' , array(
'default' => '#39409b',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_nav_active_link_color' , array(
'default' => '#ffffff',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_nav_active_link_background_color' , array(
'default' => '#272c72',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_nav_hamburger_color' , array(
'default' => '#ffffff',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
// Footer
$wp_customize->add_setting( 'mnmlwp_footer_bg_color' , array(
'default' => '#f7f7f7',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_footer_text_color' , array(
'default' => '#37383d',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_footer_headings_color' , array(
'default' => '#37383d',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_footer_link_color' , array(
'default' => '#444bb1',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_footer_link_color_hover' , array(
'default' => '#33398c',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
// Footer Full Width
$wp_customize->add_setting( 'mnmlwp_footer_full_width_bg_color' , array(
'default' => '#f3f3f3',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_footer_full_width_text_color' , array(
'default' => '#37383d',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_footer_full_width_headings_color' , array(
'default' => '#37383d',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_footer_full_width_link_color' , array(
'default' => '#444bb1',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_footer_full_width_link_color_hover' , array(
'default' => '#33398c',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
// Section Settings Page Layout
$wp_customize->add_setting( 'mnmlwp_base_font_size' , array(
'default' => '1.125em',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_column_width' , array(
'default' => '1120px',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_excerpt_length' , array(
'default' => 60,
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_sidebar_position', array(
'default' => 'right',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_footer_columns_amount', array(
'default' => 3,
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'absint',
) );
$wp_customize->add_setting( 'mnmlwp_footer_full_width_text_align', array(
'default' => 'center',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_logo_position', array(
'default' => 'left',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_nav_is_sticky', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_center_header', array(
'default' => false,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_is_boxed', array(
'default' => false,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_show_contact_row', array(
'default' => false,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_show_sidebar_by_default', array(
'default' => false,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_hide_page_title_by_default', array(
'default' => false,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_show_read_more_link', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
// Breadcrumb navigation
if( function_exists('breadcrumb_trail') ):
$wp_customize->add_setting( 'mnmlwp_has_breadcrumbs', array(
'default' => false,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_breadcrumbs_show_on_home', array(
'default' => false,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
endif;
$wp_customize->add_setting( 'mnmlwp_nav_position', array(
'default' => 'after_header',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_nav_align', array(
'default' => 'flex-start',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_sub_menu_align_desktop', array(
'default' => 'flex-start',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_nav_align_mobile', array(
'default' => 'flex-start',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_nav_animation', array(
'default' => 'fade',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_has_header_search', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_has_nav_search', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_has_loading_layer', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'mnmlwp_sanitize_checkbox',
) );
$wp_customize->add_setting( 'mnmlwp_spinner_color' , array(
'default' => '#666666',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'mnmlwp_hamburger_class', array(
'default' => 'elastic',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_setting( 'mnmlwp_header_padding_top' , array(
'default' => 1.5,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_header_padding_bottom' , array(
'default' => 1.5,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_nav_item_padding_top_bottom' , array(
'default' => 15,
'transport' => 'refresh',
'sanitize_callback' => 'absint',
) );
$wp_customize->add_setting( 'mnmlwp_nav_item_padding_left_right' , array(
'default' => 15,
'transport' => 'refresh',
'sanitize_callback' => 'absint',
) );
$wp_customize->add_setting( 'mnmlwp_header_padding_bottom' , array(
'default' => 1.5,
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_columns_spacing_horizontal' , array(
'default' => 0,
'transport' => 'refresh',
'sanitize_callback' => 'absint',
) );
$wp_customize->add_setting( 'mnmlwp_columns_spacing_vertical' , array(
'default' => 16,
'transport' => 'refresh',
'sanitize_callback' => 'absint',
) );
function mnmlwp_sanitize_checkbox( $checked ) {
return ( ( isset( $checked ) && true == $checked ) ? true : false );
}
// Hero
$wp_customize->add_setting( 'mnmlwp_hero_base_font_size_desktop' , array(
'default' => '1',
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_hero_base_font_size_tablet' , array(
'default' => '1',
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
$wp_customize->add_setting( 'mnmlwp_hero_base_font_size_mobile' , array(
'default' => '1',
'transport' => 'refresh',
'sanitize_callback' => 'mnmlwp_sanitize_float',
) );
// General
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_body_text_color', array(
'label' => esc_html__( 'Text color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_body_text_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_headings_text_color', array(
'label' => esc_html__( 'Headings color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_headings_text_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_link_color', array(
'label' => esc_html__( 'Link color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_link_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_link_hover_color', array(
'label' => esc_html__( 'Link hover color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_link_hover_color',
) ) );
// Header
$wp_customize->add_control( 'mnmlwp_has_logo_and_title', array(
'type' => 'checkbox',
'section' => 'title_tagline',
'label' => esc_html__( 'Display logo and title?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_logo_height_desktop', array(
'type' => 'range',
'label' => esc_html__( 'Logo image height (desktop)', 'mnmlwp' ),
'section' => 'title_tagline',
'settings' => 'mnmlwp_logo_height_desktop',
'input_attrs' => array(
'min' => 1,
'max' => 8,
'step' => 0.1,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_logo_height_tablet', array(
'type' => 'range',
'label' => esc_html__( 'Logo image height (tablet)', 'mnmlwp' ),
'section' => 'title_tagline',
'settings' => 'mnmlwp_logo_height_tablet',
'input_attrs' => array(
'min' => 1,
'max' => 8,
'step' => 0.1,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_logo_height_mobile', array(
'type' => 'range',
'label' => esc_html__( 'Logo image height (mobile)', 'mnmlwp' ),
'section' => 'title_tagline',
'settings' => 'mnmlwp_logo_height_mobile',
'input_attrs' => array(
'min' => 1,
'max' => 8,
'step' => 0.1,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_logo_base_font_size_desktop', array(
'type' => 'range',
'label' => esc_html__( 'Logo base font size (desktop)', 'mnmlwp' ),
'section' => 'title_tagline',
'settings' => 'mnmlwp_logo_base_font_size_desktop',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.05,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_logo_base_font_size_tablet', array(
'type' => 'range',
'label' => esc_html__( 'Logo base font size (tablet)', 'mnmlwp' ),
'section' => 'title_tagline',
'settings' => 'mnmlwp_logo_base_font_size_tablet',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.05,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_logo_base_font_size_mobile', array(
'type' => 'range',
'label' => esc_html__( 'Logo base font size (mobile)', 'mnmlwp' ),
'section' => 'title_tagline',
'settings' => 'mnmlwp_logo_base_font_size_mobile',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.05,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_site_title_font_size', array(
'type' => 'range',
'label' => esc_html__( 'Site title font size (em)', 'mnmlwp' ),
'section' => 'title_tagline',
'settings' => 'mnmlwp_site_title_font_size',
'input_attrs' => array(
'min' => .5,
'max' => 2.5,
'step' => 0.05,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_site_subtitle_font_size', array(
'type' => 'range',
'label' => esc_html__( 'Site tagline font size (em)', 'mnmlwp' ),
'section' => 'title_tagline',
'settings' => 'mnmlwp_site_subtitle_font_size',
'input_attrs' => array(
'min' => 0.25,
'max' => 1.5,
'step' => 0.05,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_header_bg_color', array(
'label' => esc_html__( 'Header background color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_header_bg_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_logo_text_color', array(
'label' => esc_html__( 'Logo text color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_logo_text_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_logo_icon_color', array(
'label' => esc_html__( 'Logo icon color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_logo_icon_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_tagline_color', array(
'label' => esc_html__( 'Tagline color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_tagline_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_contact_row_bg_color', array(
'label' => esc_html__( 'Contact row background color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_contact_row_bg_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_contact_row_text_color', array(
'label' => esc_html__( 'Contact row text', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_contact_row_text_color',
) ) );
// Navigation
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_nav_row_color', array(
'label' => esc_html__( 'Navigation background color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_nav_row_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_nav_link_color', array(
'label' => esc_html__( 'Nav item color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_nav_link_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_nav_link_background_color', array(
'label' => esc_html__( 'Nav item background color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_nav_link_background_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_nav_link_color_hover', array(
'label' => esc_html__( 'Nav item hover color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_nav_link_color_hover',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_nav_link_background_color_hover', array(
'label' => esc_html__( 'Nav item hover background color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_nav_link_background_color_hover',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_nav_active_link_color', array(
'label' => esc_html__( 'Nav item active color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_nav_active_link_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_nav_active_link_background_color', array(
'label' => esc_html__( 'Nav item active background color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_nav_active_link_background_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_nav_hamburger_color', array(
'label' => esc_html__( 'Hamburger icon color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_nav_hamburger_color',
) ) );
// Breadcrumb navigation
if( function_exists('breadcrumb_trail') ):
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_breadcrumb_bg_color', array(
'label' => esc_html__( 'Breadcrumb background color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_breadcrumb_bg_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_breadcrumb_text_color', array(
'label' => esc_html__( 'Breadcrumb text color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_breadcrumb_text_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_breadcrumb_link_color', array(
'label' => esc_html__( 'Breadcrumb link color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_breadcrumb_link_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_breadcrumb_link_hover_color', array(
'label' => esc_html__( 'Breadcrumb link color (hover)', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_breadcrumb_link_hover_color',
) ) );
endif;
// Footer
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_bg_color', array(
'label' => esc_html__( 'Footer background color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_bg_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_text_color', array(
'label' => esc_html__( 'Footer text color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_text_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_headings_color', array(
'label' => esc_html__( 'Footer headings color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_headings_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_link_color', array(
'label' => esc_html__( 'Footer link color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_link_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_link_color_hover', array(
'label' => esc_html__( 'Footer link hover color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_link_color_hover',
) ) );
// Footer Full Width
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_full_width_bg_color', array(
'label' => esc_html__( 'Footer (full width) background color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_full_width_bg_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_full_width_text_color', array(
'label' => esc_html__( 'Footer (full width) text color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_full_width_text_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_full_width_headings_color', array(
'label' => esc_html__( 'Footer (full width) headings color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_full_width_headings_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_full_width_link_color', array(
'label' => esc_html__( 'Footer (full width) link color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_full_width_link_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_footer_full_width_link_color_hover', array(
'label' => esc_html__( 'Footer (full width) link hover color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_footer_full_width_link_color_hover',
) ) );
// Customizer Controls Page Layout
$wp_customize->add_control( 'mnmlwp_column_width', array(
'label' => esc_html__( 'Main content width (default: 1120px)', 'mnmlwp' ),
'section' => 'mnmlwp_layout_section',
'settings' => 'mnmlwp_column_width',
) );
$wp_customize->add_control( 'mnmlwp_base_font_size', array(
'label' => esc_html__( 'Base font size (default: 1.125em)', 'mnmlwp' ),
'section' => 'mnmlwp_layout_section',
'settings' => 'mnmlwp_base_font_size',
) );
$wp_customize->add_control( 'mnmlwp_logo_position', array(
'type' => 'select',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Logo position', 'mnmlwp'),
'choices' => array(
'left' => __('Left (default)', 'mnmlwp'),
'right' => __('Right', 'mnmlwp'),
),
) );
$wp_customize->add_control( 'mnmlwp_nav_position', array(
'type' => 'select',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Main menu position', 'mnmlwp'),
'choices' => array(
'before_header' => __('Before header', 'mnmlwp'),
'after_header' => __('After header (default)', 'mnmlwp'),
'inside_header' => __('Inside header', 'mnmlwp'),
),
) );
$wp_customize->add_control( 'mnmlwp_nav_align', array(
'type' => 'select',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Main menu alignment (desktop)', 'mnmlwp'),
'choices' => array(
'flex-start' => __('Left (default)', 'mnmlwp'),
'center' => __('Center', 'mnmlwp'),
'flex-end' => __('Right', 'mnmlwp'),
),
) );
$wp_customize->add_control( 'mnmlwp_sub_menu_align_desktop', array(
'type' => 'select',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Sub menu item text align (desktop)', 'mnmlwp'),
'choices' => array(
'flex-start' => __('Left (default)', 'mnmlwp'),
'center' => __('Center', 'mnmlwp'),
'flex-end' => __('Right', 'mnmlwp'),
),
) );
$wp_customize->add_control( 'mnmlwp_nav_align_mobile', array(
'type' => 'select',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Main menu alignment (mobile)', 'mnmlwp'),
'choices' => array(
'flex-start' => __('Left (default)', 'mnmlwp'),
'center' => __('Center', 'mnmlwp'),
'flex-end' => __('Right', 'mnmlwp'),
),
) );
$wp_customize->add_control( 'mnmlwp_nav_animation', array(
'type' => 'select',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Menu animation style (mobile)', 'mnmlwp'),
'choices' => array(
'fade' => 'Fade (default)',
'slide' => 'Slide',
),
) );
$wp_customize->add_control( 'mnmlwp_hamburger_class', array(
'type' => 'select',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Hamburger icon class', 'mnmlwp'),
'choices' => array(
'boring' => 'Default',
'spin' => 'Spin',
'squeeze' => 'Squeeze',
'elastic' => 'Elastic',
'arrow' => 'Arrow',
'collapse' => 'Collapse',
'slider' => 'Slider',
'stand' => 'Stand',
'spring' => 'Spring',
'3dx' => '3Dx',
),
) );
$wp_customize->add_control( 'mnmlwp_excerpt_length', array(
'label' => esc_html__( 'Excerpt length in words (default: 60)', 'mnmlwp' ),
'section' => 'mnmlwp_layout_section',
'settings' => 'mnmlwp_excerpt_length',
'type' => 'number',
) );
$wp_customize->add_control( 'mnmlwp_footer_columns_amount', array(
'type' => 'select',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Number of footer widget columns', 'mnmlwp'),
'choices' => array(
0 => '0',
1 => '1',
2 => '2',
3 => __('3 (default)', 'mnmlwp'),
4 => '4',
5 => '5',
),
) );
$wp_customize->add_control( 'mnmlwp_footer_full_width_text_align', array(
'type' => 'select',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Footer (full width) text align', 'mnmlwp'),
'choices' => array(
'center' => __('Center (default)', 'mnmlwp'),
'left' => __('Left', 'mnmlwp'),
'right' => __('Right', 'mnmlwp'),
),
) );
$wp_customize->add_control( 'mnmlwp_nav_is_sticky', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Sticky main navigation?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_center_header', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Center header content?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_is_boxed', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Boxed layout?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_has_header_search', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Include search form in header (desktop)?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_has_nav_search', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Include search form in main navigation (mobile)?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_has_loading_layer', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Show loading animation on page load?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_show_sidebar_by_default', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Show sidebar by default?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_hide_page_title_by_default', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Hide page title by default?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_show_read_more_link', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Show read more link?', 'mnmlwp'),
) );
// Breadcrumb navigation
if( function_exists('breadcrumb_trail') ):
$wp_customize->add_control( 'mnmlwp_has_breadcrumbs', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Show breadcrumbs navigation?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_breadcrumbs_show_on_home', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Show breadcrumbs navigation on home page?', 'mnmlwp'),
) );
endif;
$wp_customize->add_control( 'mnmlwp_logo_icon', array(
'label' => esc_html__( 'Logo Icon', 'mnmlwp' ),
'description' => sprintf( esc_html__('Select an icon that will be displayed together with your site logo (choose from any icon from %1$s).', 'mnmlwp' ), 'Font Awesome Icons' ),
'section' => 'title_tagline',
'settings' => 'mnmlwp_logo_icon',
) );
$wp_customize->add_control( 'mnmlwp_show_contact_row', array(
'type' => 'checkbox',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Show contact row?', 'mnmlwp'),
) );
$wp_customize->add_control( 'mnmlwp_contact_row', array(
'type' => 'textarea',
'section' => 'mnmlwp_layout_section',
'label' => esc_html__( 'Contact row', 'mnmlwp'),
'description' => esc_html__( 'This section will show at the top of your website and may include some contact information or similar stuff.', 'mnmlwp' ),
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mnmlwp_spinner_color', array(
'label' => esc_html__( 'Spinner color', 'mnmlwp' ),
'section' => 'colors',
'settings' => 'mnmlwp_spinner_color',
) ) );
$wp_customize->add_control( 'mnmlwp_header_padding_top', array(
'type' => 'range',
'label' => esc_html__( 'Header padding top', 'mnmlwp' ),
'section' => 'mnmlwp_layout_section',
'settings' => 'mnmlwp_header_padding_top',
'input_attrs' => array(
'min' => 0,
'max' => 8,
'step' => 0.1,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_header_padding_bottom', array(
'type' => 'range',
'label' => esc_html__( 'Header padding bottom', 'mnmlwp' ),
'section' => 'mnmlwp_layout_section',
'settings' => 'mnmlwp_header_padding_bottom',
'input_attrs' => array(
'min' => 0,
'max' => 8,
'step' => 0.1,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_nav_item_padding_top_bottom', array(
'type' => 'range',
'label' => esc_html__( 'Nav item padding top/bottom (desktop)', 'mnmlwp' ),
'section' => 'mnmlwp_layout_section',
'settings' => 'mnmlwp_nav_item_padding_top_bottom',
'input_attrs' => array(
'min' => 5,
'max' => 31,
'step' => 1,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_nav_item_padding_left_right', array(
'type' => 'range',
'label' => esc_html__( 'Nav item padding left/right (desktop)', 'mnmlwp' ),
'section' => 'mnmlwp_layout_section',
'settings' => 'mnmlwp_nav_item_padding_left_right',
'input_attrs' => array(
'min' => 5,
'max' => 31,
'step' => 1,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_columns_spacing_horizontal', array(
'type' => 'range',
'label' => esc_html__( 'Flex columns spacing (horizontal)', 'mnmlwp' ),
'section' => 'mnmlwp_layout_section',
'settings' => 'mnmlwp_columns_spacing_horizontal',
'input_attrs' => array(
'min' => 0,
'max' => 64,
'step' => 2,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_columns_spacing_vertical', array(
'type' => 'range',
'label' => esc_html__( 'Folumns columns spacing (vertical)', 'mnmlwp' ),
'section' => 'mnmlwp_layout_section',
'settings' => 'mnmlwp_columns_spacing_vertical',
'input_attrs' => array(
'min' => 0,
'max' => 64,
'step' => 2,
'style' => 'width:98%;'
),
) );
// Hero
$wp_customize->add_control( 'mnmlwp_hero_base_font_size_desktop', array(
'type' => 'range',
'label' => esc_html__( 'Hero content base font size (desktop)', 'mnmlwp' ),
'section' => 'mnmlwp_hero_section',
'settings' => 'mnmlwp_hero_base_font_size_desktop',
'input_attrs' => array(
'min' => 0.5,
'max' => 2,
'step' => 0.05,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_hero_base_font_size_tablet', array(
'type' => 'range',
'label' => esc_html__( 'Hero content base font size (tablet)', 'mnmlwp' ),
'section' => 'mnmlwp_hero_section',
'settings' => 'mnmlwp_hero_base_font_size_tablet',
'input_attrs' => array(
'min' => 0.5,
'max' => 2,
'step' => 0.05,
'style' => 'width:98%;'
),
) );
$wp_customize->add_control( 'mnmlwp_hero_base_font_size_mobile', array(
'type' => 'range',
'label' => esc_html__( 'Hero content base font size (mobile)', 'mnmlwp' ),
'section' => 'mnmlwp_hero_section',
'settings' => 'mnmlwp_hero_base_font_size_mobile',
'input_attrs' => array(
'min' => 0.5,
'max' => 2,
'step' => 0.05,
'style' => 'width:98%;'
),
) );
}
add_action( 'customize_register', 'mnmlwp_customize_register' );
// Custom Header
$custom_header_defaults = array(
'width' => 1920,
'height' => 540,
'default-image' => '',
'uploads' => true,
);
add_theme_support( 'custom-header', $custom_header_defaults );
// Output Customizer CSS
function mnmlwp_customizer_css()
{
echo '';
}
add_action( 'wp_head', 'mnmlwp_customizer_css');
// Theme Logo
function mnmlwp_theme_prefix_setup()
{
add_theme_support( 'custom-logo', array(
'height' => 320,
'width' => 800,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title' ),
) );
}
add_action( 'after_setup_theme', 'mnmlwp_theme_prefix_setup' );
// Adjust colors
function mnmlwp_adjust_color($hex, $adjustment)
{
$adjustment = max(-255, min(255, $adjustment));
$hex = str_replace('#', '', $hex);
if (strlen($hex) == 3)
$hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
$colors = str_split($hex, 2);
$adjusted_value = '#';
foreach($colors as $color)
{
$color = hexdec($color);
$color = max(0, min(255, $color + $adjustment));
$adjusted_value .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT);
}
return $adjusted_value;
}
// Sanitize float values
function mnmlwp_sanitize_float( $input ) {
return filter_var($input, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
}