manager->get_control( $setting->id )->choices;
// return default if not valid
return ( array_key_exists( $input, $options ) ? $input : $setting->default );
}
// number absint
function ashe_sanitize_number_absint( $number, $setting ) {
// ensure $number is an absolute integer
$number = absint( $number );
// return default if not integer
return ( $number ? $number : $setting->default );
}
// textarea
function ashe_sanitize_textarea( $input ) {
$allowedtags = array(
'a' => array(
'href' => array(),
'title' => array(),
'_blank' => array()
),
'img' => array(
'src' => array(),
'alt' => array(),
'width' => array(),
'height' => array(),
'style' => array(),
'class' => array(),
'id' => array()
),
'br' => array(),
'em' => array(),
'strong' => array()
);
// return filtered html
return wp_kses( $input, $allowedtags );
}
// Custom Controls
function ashe_sanitize_custom_control( $input ) {
return $input;
}
/*
** Reusable Functions =====
*/
// checkbox
function ashe_checkbox_control( $section, $id, $name, $transport, $priority ) {
global $wp_customize;
if ( $section !== 'header_image' ) {
$section_id = 'ashe_'. $section;
} else {
$section_id = $section;
}
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => ashe_options( $section .'_'. $id),
'type' => 'option',
'transport' => $transport,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'ashe_sanitize_checkbox'
) );
$wp_customize->add_control( 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'section' => $section_id,
'type' => 'checkbox',
'priority' => $priority
) );
}
// text
function ashe_text_control( $section, $id, $name, $transport, $priority ) {
global $wp_customize;
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => ashe_options( $section .'_'. $id),
'type' => 'option',
'transport' => $transport,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field'
) );
$wp_customize->add_control( 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'section' => 'ashe_'. $section,
'type' => 'text',
'priority' => $priority
) );
}
// color
function ashe_color_control( $section, $id, $name, $transport, $priority ) {
global $wp_customize;
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => ashe_options( $section .'_'. $id),
'type' => 'option',
'transport' => $transport,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_hex_color'
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'section' => 'ashe_'. $section,
'priority' => $priority
) ) );
}
// textarea
function ashe_textarea_control( $section, $id, $name, $description, $transport, $priority ) {
global $wp_customize;
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => ashe_options( $section .'_'. $id),
'type' => 'option',
'transport' => $transport,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'ashe_sanitize_textarea'
) );
$wp_customize->add_control( 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'description' => wp_kses_post($description),
'section' => 'ashe_'. $section,
'type' => 'textarea',
'priority' => $priority
) );
}
// url
function ashe_url_control( $section, $id, $name, $transport, $priority ) {
global $wp_customize;
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => ashe_options( $section .'_'. $id),
'type' => 'option',
'transport' => $transport,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_url_raw'
) );
$wp_customize->add_control( 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'section' => 'ashe_'. $section,
'type' => 'text',
'priority' => $priority
) );
}
// number absint
function ashe_number_absint_control( $section, $id, $name, $atts, $transport, $priority ) {
global $wp_customize;
if ( $section !== 'title_tagline' && $section !== 'header_image' ) {
$section_id = 'ashe_'. $section;
} else {
$section_id = $section;
}
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => ashe_options( $section .'_'. $id),
'type' => 'option',
'transport' => $transport,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'ashe_sanitize_number_absint'
) );
$wp_customize->add_control( 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'section' => $section_id,
'type' => 'number',
'input_attrs' => $atts,
'priority' => $priority
) );
}
// select
function ashe_select_control( $section, $id, $name, $atts, $transport, $priority ) {
global $wp_customize;
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => ashe_options( $section .'_'. $id),
'type' => 'option',
'transport' => $transport,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'ashe_sanitize_select'
) );
$wp_customize->add_control( 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'section' => 'ashe_'. $section,
'type' => 'select',
'choices' => $atts,
'priority' => $priority
) );
}
// radio
function ashe_radio_control( $section, $id, $name, $atts, $transport, $priority ) {
global $wp_customize;
if ( $section !== 'header_image' ) {
$section_id = 'ashe_'. $section;
} else {
$section_id = $section;
}
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => ashe_options( $section .'_'. $id),
'type' => 'option',
'transport' => $transport,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'ashe_sanitize_select'
) );
$wp_customize->add_control( 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'section' => $section_id,
'type' => 'radio',
'choices' => $atts,
'priority' => $priority
) );
}
// image
function ashe_image_control( $section, $id, $name, $transport, $priority ) {
global $wp_customize;
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => ashe_options( $section .'_'. $id),
'type' => 'option',
'transport' => $transport,
'sanitize_callback' => 'esc_url_raw'
) );
$wp_customize->add_control(
new WP_Customize_Image_Control( $wp_customize, 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'section' => 'ashe_'. $section,
'priority' => $priority
)
) );
}
// image crop
function ashe_image_crop_control( $section, $id, $name, $width, $height, $transport, $priority ) {
global $wp_customize;
$wp_customize->add_setting( 'ashe_options['. $section .'_'. $id .']', array(
'default' => '',
'type' => 'option',
'transport' => $transport,
'sanitize_callback' => 'ashe_sanitize_number_absint'
) );
$wp_customize->add_control(
new WP_Customize_Cropped_Image_Control( $wp_customize, 'ashe_options['. $section .'_'. $id .']', array(
'label' => $name,
'section' => 'ashe_'. $section,
'flex_width' => false,
'flex_height' => false,
'width' => $width,
'height' => $height,
'priority' => $priority
)
) );
}
// Pro Version
class Ashe_Customize_Pro_Version extends WP_Customize_Control {
public $type = 'pro_options';
public function render_content() {
echo '';
echo ' '. esc_html( $this->label ) .' ';
echo 'Ashe PRO';
echo '';
}
}
// Pro Version Links
class Ashe_Customize_Pro_Version_Links extends WP_Customize_Control {
public $type = 'pro_links';
public function render_content() {
?>
-
Upgrade *
There are lots of reasons to upgrade to Pro version. Unlimited custom Colors, rich Typography options, multiple variation of Blog Feed layout and way much more. Also Premium Support included.
-
Try For Free *
You can download the full version of Ashe Pro theme for free to try it out during 14 days.
-
Documentation
Read how to customize the theme, set up widgets, and learn all the possible options available to you.
-
Support
For Ashe theme related questions feel free to post on our support forums. But firstly pleaseRegister on Support Forums
-
Demo Content
You can download and import this demo file to get same content as shown on our website. For more details please read theme documentation.
add_section( 'ashe_pro' , array(
'title' => esc_html__( 'About Ashe', 'ashe' ),
'priority' => 1,
'capability' => 'edit_theme_options'
) );
// Pro Version
$wp_customize->add_setting( 'pro_version_', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version_Links ( $wp_customize,
'pro_version_', array(
'section' => 'ashe_pro',
'type' => 'pro_links',
'label' => '',
'priority' => 1
)
)
);
/*
** Colors =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_colors', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_colors', array(
'section' => 'ashe_colors',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Colors? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/colors.html?ref=ashe-free-colors-customizer' ),
'priority' => 1
)
)
);
// add Colors section
$wp_customize->add_section( 'ashe_colors' , array(
'title' => esc_html__( 'Colors', 'ashe' ),
'priority' => 1,
'capability' => 'edit_theme_options'
) );
// Content Accent
ashe_color_control( 'colors', 'content_accent', esc_html__( 'Accent', 'ashe' ), 'postMessage', 3 );
$wp_customize->get_control( 'header_textcolor' )->section = 'ashe_colors';
$wp_customize->get_control( 'header_textcolor' )->priority = 6;
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
// Header Background
ashe_color_control( 'colors', 'header_bg', esc_html__( 'Header Background Color', 'ashe' ), 'postMessage', 9 );
// Body Background
$wp_customize->get_control( 'background_color' )->section = 'ashe_colors';
$wp_customize->get_control( 'background_color' )->priority = 12;
$wp_customize->get_control( 'background_color' )->label = 'Body Background Color';
$wp_customize->get_control( 'background_image' )->section = 'ashe_colors';
$wp_customize->get_control( 'background_image' )->priority = 15;
$wp_customize->get_control( 'background_preset' )->section = 'ashe_colors';
$wp_customize->get_control( 'background_preset' )->priority = 18;
$wp_customize->get_control( 'background_position' )->section = 'ashe_colors';
$wp_customize->get_control( 'background_position' )->priority = 21;
$wp_customize->get_control( 'background_size' )->section = 'ashe_colors';
$wp_customize->get_control( 'background_size' )->priority = 23;
$wp_customize->get_control( 'background_repeat' )->section = 'ashe_colors';
$wp_customize->get_control( 'background_repeat' )->priority = 25;
$wp_customize->get_control( 'background_attachment' )->section = 'ashe_colors';
$wp_customize->get_control( 'background_attachment' )->priority = 27;
/*
** General Layouts =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_general_layouts', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_general_layouts', array(
'section' => 'ashe_general',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Options? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/general-layouts.html?ref=ashe-free-general-layouts-customizer' ),
'priority' => 1
)
)
);
// add General Layouts section
$wp_customize->add_section( 'ashe_general' , array(
'title' => esc_html__( 'General Layouts', 'ashe' ),
'priority' => 3,
'capability' => 'edit_theme_options'
) );
// Sidebar Width
ashe_number_absint_control( 'general', 'sidebar_width', esc_html__( 'Sidebar Width', 'ashe' ), array( 'step' => '1' ), 'refresh', 3 );
// Sticky Sidebar
ashe_checkbox_control( 'general', 'sidebar_sticky', esc_html__( 'Enable Sticky Sidebar', 'ashe' ), 'refresh', 5 );
$boxed_width = array(
'full' => esc_html__( 'Full', 'ashe' ),
'contained' => esc_html__( 'Contained', 'ashe' ),
'boxed' => esc_html__( 'Boxed', 'ashe' ),
);
// Header Width
ashe_select_control( 'general', 'header_width', esc_html__( 'Header Width', 'ashe' ), $boxed_width, 'refresh', 25 );
$boxed_width_slider = array(
'full' => esc_html__( 'Full', 'ashe' ),
'boxed' => esc_html__( 'Boxed', 'ashe' ),
);
// Slider Width
ashe_select_control( 'general', 'slider_width', esc_html__( 'Featured Slider Width', 'ashe' ), $boxed_width_slider, 'refresh', 27 );
// Featured Links Width
ashe_select_control( 'general', 'links_width', esc_html__( 'Featured Links Width', 'ashe' ), $boxed_width_slider, 'refresh', 28 );
// Content Width
ashe_select_control( 'general', 'content_width', esc_html__( 'Content Width', 'ashe' ), $boxed_width_slider, 'refresh', 29 );
// Single Content Width
ashe_select_control( 'general', 'single_width', esc_html__( 'Single Content Width', 'ashe' ), $boxed_width_slider, 'refresh', 31 );
// Footer Width
ashe_select_control( 'general', 'footer_width', esc_html__( 'Footer Width', 'ashe' ), $boxed_width, 'refresh', 33 );
/*
** Top Bar =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_top_bar', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_top_bar', array(
'section' => 'ashe_top_bar',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Options? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/top-bar.html?ref=ashe-free-top-bar-customizer' ),
'priority' => 1
)
)
);
// add Top Bar section
$wp_customize->add_section( 'ashe_top_bar' , array(
'title' => esc_html__( 'Top Bar', 'ashe' ),
'priority' => 5,
'capability' => 'edit_theme_options'
) );
// Top Bar label
ashe_checkbox_control( 'top_bar', 'label', esc_html__( 'Top Bar', 'ashe' ), 'refresh', 1 );
/*
** Header Image =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_header_image', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_header_image', array(
'section' => 'header_image',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Options? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/header-image.html?ref=ashe-free-header-image-customizer' ),
'priority' => 1
)
)
);
$wp_customize->get_section( 'header_image' )->priority = 10;
// Page Header label
ashe_checkbox_control( 'header_image', 'label', esc_html__( 'Page Header', 'ashe' ), 'refresh', 1 );
$bg_image_size = array(
'cover' => esc_html__( 'Cover', 'ashe' ),
'initial' => esc_html__( 'Pattern', 'ashe' )
);
// Background Image Size
ashe_radio_control( 'header_image', 'bg_image_size', esc_html__( 'Background Image Size', 'ashe' ), $bg_image_size, 'refresh', 10 );
/*
** Site Identity =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_site_identity', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_site_identity', array(
'section' => 'title_tagline',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Options? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/site-identity.html?ref=ashe-free-site-identity-customizer' ),
'priority' => 1
)
)
);
// Logo Width
ashe_number_absint_control( 'title_tagline', 'logo_width', esc_html__( 'Width', 'ashe' ), array( 'step' => '10' ), 'postMessage', 8 );
$wp_customize->get_control( 'custom_logo' )->transport = 'selective_refresh';
/*
** Main Navigation =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_main_navigation', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_main_navigation', array(
'section' => 'ashe_main_nav',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Options? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/main-navigation.html?ref=ashe-free-main-navigation-customizer' ),
'priority' => 1
)
)
);
// add Main Navigation section
$wp_customize->add_section( 'ashe_main_nav' , array(
'title' => esc_html__( 'Main Navigation', 'ashe' ),
'priority' => 23,
'capability' => 'edit_theme_options'
) );
// Main Navigation
ashe_checkbox_control( 'main_nav', 'label', esc_html__( 'Main Navigation', 'ashe' ), 'refresh', 1 );
$main_nav_align = array(
'left' => esc_html__( 'Left', 'ashe' ),
'center' => esc_html__( 'Center', 'ashe' ),
'right' => esc_html__( 'Right', 'ashe' ),
);
// Align
ashe_select_control( 'main_nav', 'align', esc_html__( 'Align', 'ashe' ), $main_nav_align, 'refresh', 7 );
$main_nav_position = array(
'above' => esc_html__( 'Above Page Header', 'ashe' ),
'below' => esc_html__( 'Below Page Header', 'ashe' ),
);
// Show Search Icon
ashe_checkbox_control( 'main_nav', 'show_search', esc_html__( 'Show Search Icon', 'ashe' ), 'refresh', 13 );
// Show Sidebar Icon
ashe_checkbox_control( 'main_nav', 'show_sidebar', esc_html__( 'Show Sidebar Icon', 'ashe' ), 'refresh', 15 );
/*
** Featured Slider =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_featured_slider', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_featured_slider', array(
'section' => 'ashe_featured_slider',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Options? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/featured-slider.html?ref=ashe-free-featured-slider-customizer' ),
'priority' => 1
)
)
);
// add featured slider section
$wp_customize->add_section( 'ashe_featured_slider' , array(
'title' => esc_html__( 'Featured Slider', 'ashe' ),
'priority' => 25,
'capability' => 'edit_theme_options'
) );
// Featured Slider
ashe_checkbox_control( 'featured_slider', 'label', esc_html__( 'Featured Slider', 'ashe' ), 'refresh', 1 );
$slider_display = array(
'all' => 'All Posts',
'category' => 'by Post Category'
);
// Display
ashe_select_control( 'featured_slider', 'display', esc_html__( 'Display Posts', 'ashe' ), $slider_display, 'refresh', 2 );
$slider_cats = array();
foreach ( get_categories() as $categories => $category ) {
$slider_cats[$category->term_id] = $category->name;
}
// Category
ashe_select_control( 'featured_slider', 'category', esc_html__( 'Select Category', 'ashe' ), $slider_cats, 'refresh', 3 );
// Amount
ashe_number_absint_control( 'featured_slider', 'amount', esc_html__( 'Number of Slides', 'ashe' ), array( 'step' => '1', 'max' => '5' ), 'refresh', 10 );
$slider_culumns = array( 'step' => '1', 'min' => '1', 'max' => '4' );
// Navigation
ashe_checkbox_control( 'featured_slider', 'navigation', esc_html__( 'Show Navigation Arrows', 'ashe' ), 'refresh', 25 );
// Pagination
ashe_checkbox_control( 'featured_slider', 'pagination', esc_html__( 'Show Pagination Dots', 'ashe' ), 'refresh', 30 );
/*
** Featured Links =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_featured_links', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_featured_links', array(
'section' => 'ashe_featured_links',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Links? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/featured-links.html?ref=ashe-free-featured-links-customizer' ),
'priority' => 1
)
)
);
// add featured links section
$wp_customize->add_section( 'ashe_featured_links' , array(
'title' => esc_html__( 'Featured Links', 'ashe' ),
'priority' => 27,
'capability' => 'edit_theme_options'
) );
// Featured Links
ashe_checkbox_control( 'featured_links', 'label', esc_html__( 'Featured Links', 'ashe' ), 'refresh', 1 );
// Link #1 Title
ashe_text_control( 'featured_links', 'title_1', esc_html__( 'Title', 'ashe' ), 'refresh', 9 );
// Link #1 URL
ashe_url_control( 'featured_links', 'url_1', esc_html__( 'URL', 'ashe' ), 'refresh', 11 );
// Link #1 Image
ashe_image_crop_control( 'featured_links', 'image_1', esc_html__( 'Image', 'ashe' ), 600, 340, 'refresh', 13 );
// Link #2 Title
ashe_text_control( 'featured_links', 'title_2', esc_html__( 'Title', 'ashe' ), 'refresh', 15 );
// Link #2 URL
ashe_url_control( 'featured_links', 'url_2', esc_html__( 'URL', 'ashe' ), 'refresh', 17 );
// Link #2 Image
ashe_image_crop_control( 'featured_links', 'image_2', esc_html__( 'Image', 'ashe' ), 600, 340, 'refresh', 19 );
// Link #3 Title
ashe_text_control( 'featured_links', 'title_3', esc_html__( 'Title', 'ashe' ), 'refresh', 21 );
// Link #3 URL
ashe_url_control( 'featured_links', 'url_3', esc_html__( 'URL', 'ashe' ), 'refresh', 23 );
// Link #3 Image
ashe_image_crop_control( 'featured_links', 'image_3', esc_html__( 'Image', 'ashe' ), 600, 340, 'refresh', 25 );
/*
** Blog Page =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_blog_page', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_blog_page', array(
'section' => 'ashe_blog_page',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Options? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/blog-page.html?ref=ashe-free-blog-page-customizer' ),
'priority' => 1
)
)
);
// add Blog Page section
$wp_customize->add_section( 'ashe_blog_page' , array(
'title' => esc_html__( 'Blog Page', 'ashe' ),
'priority' => 29,
'capability' => 'edit_theme_options'
) );
$post_description = array(
'none' => esc_html__( 'None', 'ashe' ),
'excerpt' => esc_html__( 'Post Excerpt', 'ashe' ),
'content' => esc_html__( 'Post Content', 'ashe' ),
);
// Post Description
ashe_select_control( 'blog_page', 'post_description', esc_html__( 'Post Description', 'ashe' ), $post_description, 'refresh', 3 );
$post_pagination = array(
'default' => esc_html__( 'Default', 'ashe' ),
'numeric' => esc_html__( 'Numeric', 'ashe' ),
);
// Post Pagination
ashe_select_control( 'blog_page', 'post_pagination', esc_html__( 'Post Pagination', 'ashe' ), $post_pagination, 'refresh', 5 );
// Show Categories
ashe_checkbox_control( 'blog_page', 'show_categories', esc_html__( 'Show Categories', 'ashe' ), 'refresh', 6 );
// Show Date
ashe_checkbox_control( 'blog_page', 'show_date', esc_html__( 'Show Date', 'ashe' ), 'refresh', 7 );
// Show Comments
ashe_checkbox_control( 'blog_page', 'show_comments', esc_html__( 'Show Comments', 'ashe' ), 'refresh', 9 );
// Show Drop Caps
ashe_checkbox_control( 'blog_page', 'show_dropcaps', esc_html__( 'Show Drop Caps', 'ashe' ), 'refresh', 11 );
// Show Author
ashe_checkbox_control( 'blog_page', 'show_author', esc_html__( 'Show Author', 'ashe' ), 'refresh', 16 );
$related_posts = array(
'none' => esc_html__( 'None', 'ashe' ),
'related' => esc_html__( 'Related', 'ashe' )
);
// Related Posts Orderby
ashe_select_control( 'blog_page', 'related_orderby', esc_html__( 'Related Posts Display', 'ashe' ), $related_posts, 'refresh', 33 );
/*
** Single Page =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_blog-single', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_blog-single', array(
'section' => 'ashe_single_page',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Options? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/single-page.html?ref=ashe-free-blog-single-customizer' ),
'priority' => 1
)
)
);
// add single Page section
$wp_customize->add_section( 'ashe_single_page' , array(
'title' => esc_html__( 'Single Page', 'ashe' ),
'priority' => 31,
'capability' => 'edit_theme_options'
) );
// Show Categories
ashe_checkbox_control( 'single_page', 'show_categories', esc_html__( 'Show Categories', 'ashe' ), 'refresh', 5 );
// Show Date
ashe_checkbox_control( 'single_page', 'show_date', esc_html__( 'Show Date', 'ashe' ), 'refresh', 7 );
// Show Comments
ashe_checkbox_control( 'single_page', 'show_comments', esc_html__( 'Show Comments', 'ashe' ), 'refresh', 13 );
// Show Author
ashe_checkbox_control( 'single_page', 'show_author', esc_html__( 'Show Author', 'ashe' ), 'refresh', 15 );
// Show Author Description
ashe_checkbox_control( 'single_page', 'show_author_desc', esc_html__( 'Show Author Description', 'ashe' ), 'refresh', 18 );
// Related Posts Orderby
ashe_select_control( 'single_page', 'related_orderby', esc_html__( 'Related Posts - Display', 'ashe' ), $related_posts, 'refresh', 23 );
/*
** Social Media =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_social_media', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_social_media', array(
'section' => 'ashe_social_media',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Media? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/social-media.html?ref=ashe-free-social-media-customizer' ),
'priority' => 1
)
)
);
// add social media section
$wp_customize->add_section( 'ashe_social_media' , array(
'title' => esc_html__( 'Social Media', 'ashe' ),
'priority' => 33,
'capability' => 'edit_theme_options'
) );
// Social Window
ashe_checkbox_control( 'social_media', 'window', esc_html__( 'Show Social Icons in New Window', 'ashe' ), 'refresh', 1 );
// Social Icons Array
$social_icons = array(
'facebook' => '',
'facebook-official' => '',
'facebook-square' => '',
'twitter' => '',
'twitter-square' => '',
'google' => '',
'google-plus' => '',
'google-plus-official' => '',
'google-plus-square' => '',
'linkedin' => '',
'linkedin-square' => '',
'pinterest' => '',
'pinterest-p' => '',
'pinterest-square' => '',
'behance' => '',
'behance-square' => '',
'tumblr' => '',
'tumblr-square' => '',
'reddit' => '',
'reddit-alien' => '',
'reddit-square' => '',
'dribbble' => '',
'vk' => '',
'skype' => '',
'film' => '',
'youtube-play' => '',
'youtube' => '',
'youtube-square' => '',
'vimeo-square' => '',
'soundcloud' => '',
'instagram' => '',
'flickr' => '',
'rss' => '',
'rss-square' => '',
'heart' => '',
'heart-o' => '',
'github' => '',
'github-alt' => '',
'github-square' => '',
'stack-overflow' => '',
'qq' => '',
'weibo' => '',
'weixin' => '',
'xing' => '',
'xing-square' => '',
'gamepad' => '',
'medium' => '',
'envelope' => '',
'envelope-o' => '',
'envelope-square ' => '',
'etsy' => '',
'snapchat' => '',
'snapchat-ghost' => '',
'snapchat-square' => '',
'meetup' => '',
);
// Social #1 Icon
ashe_select_control( 'social_media', 'icon_1', esc_html__( 'Select Icon', 'ashe' ), $social_icons, 'refresh', 3 );
// Social #1 Icon
ashe_url_control( 'social_media', 'url_1', esc_html__( 'URL', 'ashe' ), 'refresh', 5 );
// Social #2 Icon
ashe_select_control( 'social_media', 'icon_2', esc_html__( 'Select Icon', 'ashe' ), $social_icons, 'refresh', 7 );
// Social #2 Icon
ashe_url_control( 'social_media', 'url_2', esc_html__( 'URL', 'ashe' ), 'refresh', 9 );
// Social #3 Icon
ashe_select_control( 'social_media', 'icon_3', esc_html__( 'Select Icon', 'ashe' ), $social_icons, 'refresh', 11 );
// Social #3 Icon
ashe_url_control( 'social_media', 'url_3', esc_html__( 'URL', 'ashe' ), 'refresh', 13 );
// Social #4 Icon
ashe_select_control( 'social_media', 'icon_4', esc_html__( 'Select Icon', 'ashe' ), $social_icons, 'refresh', 15 );
// Social #4 Icon
ashe_url_control( 'social_media', 'url_4', esc_html__( 'URL', 'ashe' ), 'refresh', 17 );
/*
** Page Footer =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_page_footer', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_page_footer', array(
'section' => 'ashe_page_footer',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Options? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/page-footer.html?ref=ashe-free-page-footer-customizer' ),
'priority' => 1
)
)
);
// add page footer section
$wp_customize->add_section( 'ashe_page_footer' , array(
'title' => esc_html__( 'Page Footer', 'ashe' ),
'priority' => 35,
'capability' => 'edit_theme_options'
) );
$copyright_description = 'Enter $year to update the year automatically and $copy for the copyright symbol.
Example: $year Ashe Theme $copy.';
// Copyright
ashe_textarea_control( 'page_footer', 'copyright', esc_html__( 'Copyright', 'ashe' ), $copyright_description, 'refresh', 3 );
/*
** Preloader =====
*/
// Pro Version
$wp_customize->add_setting( 'pro_version_preloader', array(
'sanitize_callback' => 'ashe_sanitize_custom_control'
) );
$wp_customize->add_control( new Ashe_Customize_Pro_Version ( $wp_customize,
'pro_version_preloader', array(
'section' => 'ashe_preloader',
'type' => 'pro_options',
'label' => esc_html__( 'Want more Animations? See ', 'ashe' ),
'description' => esc_html( 'wp-royal.com/themes/ashe/customizer/free/preloader.html?ref=ashe-free-preloader-customizer' ),
'priority' => 1
)
)
);
// add Preloader section
$wp_customize->add_section( 'ashe_preloader' , array(
'title' => esc_html__( 'Preloader', 'ashe' ),
'priority' => 45,
'capability' => 'edit_theme_options'
) );
// Preloading Animation
ashe_checkbox_control( 'preloader', 'label', esc_html__( 'Preloading Animation', 'ashe' ), 'refresh', 1 );
}
add_action( 'customize_register', 'ashe_customize_register' );
/*
** Bind JS handlers to instantly live-preview changes
*/
function ashe_customize_preview_js() {
wp_enqueue_script( 'ashe-customize-preview', get_theme_file_uri( '/inc/customizer/js/customize-preview.js' ), array( 'customize-preview' ), '1.0', true );
}
add_action( 'customize_preview_init', 'ashe_customize_preview_js' );
/*
** Load dynamic logic for the customizer controls area.
*/
function ashe_panels_js() {
wp_enqueue_style( 'fontawesome', get_theme_file_uri( '/assets/css/font-awesome.css' ) );
wp_enqueue_style( 'customizer-ui-css', get_theme_file_uri( '/inc/customizer/css/customizer-ui.css' ) );
wp_enqueue_script( 'ashe-customize-controls', get_theme_file_uri( '/inc/customizer/js/customize-controls.js' ), array(), '1.0', true );
}
add_action( 'customize_controls_enqueue_scripts', 'ashe_panels_js' );