add_section( 'atout_logo', array(
'priority' => 20,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Logo', 'atout'),
'description' => '',
));
// -----------------------------------------------------------------------------
$wp_customize->add_section( 'atout_post_options', array(
'priority' => 30,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Post Options', 'atout'),
'description' => '',
));
// -----------------------------------------------------------------------------
$wp_customize->add_section( 'atout_navbar', array(
'priority' => 40,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Header & Navbar', 'atout'),
'description' => '',
));
// -----------------------------------------------------------------------------
$wp_customize->add_section( 'atout_layout', array(
'priority' => 50,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Layout', 'atout'),
'description' => '',
));
// -----------------------------------------------------------------------------
$wp_customize->add_section( 'atout_fonts', array(
'priority' => 70,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Font Options', 'atout'),
'description' => '',
));
// -----------------------------------------------------------------------------
$wp_customize->add_section( 'atout_login', array(
'priority' => 80,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Login', 'atout'),
'description' => '',
));
// -----------------------------------------------------------------------------
$wp_customize->add_section( 'atout_favicon_section', array(
'priority' => 100,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Favicon', 'atout'),
'description' => '',
));
// -----------------------------------------------------------------------------
$wp_customize->add_section( 'atout_footer', array(
'priority' => 110,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Footer', 'atout'),
'description' => '',
));
// =============================================================================
// Settings & Controls
// =============================================================================
/**
* Logo
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting( 'logo', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'atout_logo_option', array(
'label' => __( 'Logo', 'atout' ),
'section' => 'atout_logo',
'settings' => 'logo',
'description' => __('Choose an image to replace the website\'s name in the header. Format must be .png.
Height should be 80px
Width should not exceed 240px.', 'atout'),
)));
// -----------------------------------------------------------------------------
/**
* Favicon
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting( 'atout_favicon', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'atout_favicon_option', array(
'label' => __( 'Favicon', 'atout' ),
'section' => 'atout_favicon_section',
'settings' => 'atout_favicon',
'description' => __('Change your site\'s favicon, Image must be 16x16px or 32x32px, format must be .png', 'atout'),
)));
// -----------------------------------------------------------------------------
/**
* Apple bookmark for iPhones
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting( 'atout_bookmark_iphone', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'atout_bookmark_iphone_option', array(
'label' => __( 'Retina iPhone Bookmark', 'atout' ),
'section' => 'atout_favicon_section',
'settings' => 'atout_bookmark_iphone',
'description' => __('Upload image to be used as bookmark on iPhones with retina screen. Size must be 120x120 and format .png', 'atout'),
)));
// -----------------------------------------------------------------------------
/**
* Apple bookmark for iPads
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting( 'atout_bookmark_ipad', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'atout_bookmark_ipad_option', array(
'label' => __( 'Retina iPad Bookmark', 'atout' ),
'section' => 'atout_favicon_section',
'settings' => 'atout_bookmark_ipad',
'description' => __('Upload image to be used as bookmark on iPads with retina screen. Size must be 152x152 and format .png', 'atout'),
)));
// -----------------------------------------------------------------------------
/**
* Apple bookmark for iPads
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting( 'atout_bookmark_other', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'atout_bookmark_other_option', array(
'label' => __( 'Bookmark Icon', 'atout' ),
'section' => 'atout_favicon_section',
'settings' => 'atout_bookmark_other',
'description' => __('Upload image to be used as bookmark icon on other Apple devices. Size must be 76x76px and format .png', 'atout'),
)));
// -----------------------------------------------------------------------------
/**
* Default or custom login page
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting('custom_login', array(
'default' => 'true',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'transport' => 'refresh',
'sanitize_callback' => 'atout_sanitize_login_page',
));
$wp_customize->add_control('custom_login', array(
'label' => __('Login page', 'atout'),
'section' => 'atout_login',
'settings' => 'custom_login',
'description' => __('Choose to use the default wordpress login page or the theme custom login page', 'atout'),
'type' => 'radio',
'choices' => array(
'true' => __('Custom login', 'atout'),
'false' => __('Default login', 'atout')
),
));
// -----------------------------------------------------------------------------
/**
* Fixed/static navbar
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting('topbar_show', array(
'default' => 'none',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'transport' => 'refresh',
'sanitize_callback' => 'atout_sanitize_topbar',
));
$wp_customize->add_control('topbar_show', array(
'label' => __('Topbar', 'atout'),
'section' => 'atout_navbar',
'settings' => 'topbar_show',
'description' => __('Choose to hide or show the top navigation bar. Please note: this bar will be replaced by the native WP admin bar when logged in.', 'atout'),
'type' => 'radio',
'choices' => array(
'block'=> __('Show', 'atout'),
'none' => __('Hide', 'atout')
),
));
// -----------------------------------------------------------------------------
/**
* Fixed/static navbar
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting('navbar_state', array(
'default' => 'static',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'transport' => 'refresh',
'sanitize_callback' => 'atout_sanitize_navbar_state',
));
$wp_customize->add_control('navbar_state', array(
'label' => __('Fixed Navbar', 'atout'),
'section' => 'atout_navbar',
'settings' => 'navbar_state',
'description' => __('Pick fixed and your navbar will be fixed to the top of the page.', 'atout'),
'type' => 'radio',
'choices' => array(
'static'=> __('static', 'atout'),
'fixed' => __('fixed', 'atout')
),
));
// -----------------------------------------------------------------------------
/**
* Search form in header
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting('nav_search', array(
'default' => 'block',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'transport' => 'refresh',
'sanitize_callback' => 'atout_sanitize_display_block',
));
$wp_customize->add_control('nav_search', array(
'label' => __('Search form', 'atout'),
'section' => 'atout_navbar',
'settings' => 'nav_search',
'description' => __('Set to yes to display the search form in the site header.', 'atout'),
'type' => 'radio',
'choices' => array(
'block'=> __('Yes', 'atout'),
'none' => __('No', 'atout')
),
));
// -----------------------------------------------------------------------------
/**
* Thumbnail link to post?
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting('thumbnail_link', array(
'default' => 'yes',
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'transport' => 'refresh',
'sanitize_callback' => 'atout_sanitize_thumbnail_link',
));
$wp_customize->add_control('thumbnail_link', array(
'label' => __('Thumbnail Link', 'atout'),
'section' => 'atout_post_options',
'settings' => 'thumbnail_link',
'description' => __('Do you want thumbnails to be linked to their article?', 'atout'),
'type' => 'radio',
'choices' => array(
'yes'=> __('Yes', 'atout'),
'no' => __('No', 'atout')
),
));
// -----------------------------------------------------------------------------
/**
* Btn color
* @author Frenchtastic
* @since Atout 1.0
*/
$wp_customize->add_setting( 'primary_color',
array(
'default' => '4671fb',
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize,
'atout_primary_color',
array(
'label' => __( 'Accent color', 'atout' ),
'section' => 'colors',
'settings' => 'primary_color',
'priority' => 10,
'description' => __('Not feeling inspired? Try these ones:
#d62862
#4671fb
#7ad03a
#f1c40f
#29d9c2
#e74c3c