$general_panel,
'title' => __('General', 'avish'),
'description' => __('This panel is used for managing general section of your site.', 'avish'),
'priority' => 10
);
// RSS
$section = PREFIX . 'rss-section';
$sections[] = array(
'id' => $section,
'title' => __('RSS', 'avish'),
'priority' => 100,
'panel' => $general_panel,
'description' => __('If you fill the custom rss url below, it will replace the default.', 'avish'),
);
$options[PREFIX . 'custom-rss'] = array(
'id' => PREFIX . 'custom-rss',
'label' => __('Custom RSS URL (eg. Feedburner)', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
// Comment
$section = PREFIX . 'comment-section';
$sections[] = array(
'id' => $section,
'title' => __('Comments', 'avish'),
'priority' => 110,
'panel' => $general_panel,
);
$options[PREFIX . 'page-comment'] = array(
'id' => PREFIX . 'page-comment',
'label' => __('Page Comment', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
// Comment
$section = PREFIX . 'post-date-section';
$sections[] = array(
'id' => $section,
'title' => __('Post Date Style', 'avish'),
'priority' => 115,
'panel' => $general_panel,
);
$options[PREFIX . 'post-date-style'] = array(
'id' => PREFIX . 'post-date-style',
'label' => __('Style', 'avish'),
'section' => $section,
'type' => 'select',
'default' => 'absolute',
'choices' => array(
'absolute' => __('Absolute (June 20, 2015 10:19 am)', 'avish'),
'relative' => __('Relative (1 week ago)', 'avish')
)
);
// Social header
$section = PREFIX . 'social-section';
$sections[] = array(
'id' => $section,
'title' => __('Social', 'avish'),
'priority' => 120,
'panel' => $general_panel
);
$options[PREFIX . 'twitter'] = array(
'id' => PREFIX . 'twitter',
'label' => __('Twitter URL', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'facebook'] = array(
'id' => PREFIX . 'facebook',
'label' => __('Facebook URL', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'gplus'] = array(
'id' => PREFIX . 'gplus',
'label' => __('Google Plus URL', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'instagram'] = array(
'id' => PREFIX . 'instagram',
'label' => __('Instagram URL', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'pinterest'] = array(
'id' => PREFIX . 'pinterest',
'label' => __('Pinterest URL', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'linkedin'] = array(
'id' => PREFIX . 'linkedin',
'label' => __('LinkedIn URL', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'tumblr'] = array(
'id' => PREFIX . 'tumblr',
'label' => __('Tumblr URL', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'rss'] = array(
'id' => PREFIX . 'rss',
'label' => __('RSS URL', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
// Footer Text
$section = PREFIX . 'footer-text-section';
$sections[] = array(
'id' => $section,
'title' => __('Footer Text', 'avish'),
'priority' => 130,
'panel' => $general_panel,
);
$theme = wp_get_theme();
$options[PREFIX . 'footer-text'] = array(
'id' => PREFIX . 'footer-text',
'label' => '',
'description' => __('Customize the footer text.', 'avish'),
'section' => $section,
'type' => 'textarea',
'default' => sprintf(__('© %1$s %2$s · %3$s %4$s · Designed by %5$s', 'avish'),
date('Y'),
'' . esc_attr(get_bloginfo('name')) . '',
'',
'' . esc_attr($theme->get('Name')) . '',
'' . esc_attr($theme->get('Author')) . '.')
);
// Header Panels and Sections
$header_panel = 'header';
$panels[] = array(
'id' => $header_panel,
'title' => __('Header', 'avish'),
'description' => __('This panel is used for managing header section of your site.', 'avish'),
'priority' => 15
);
// Logo
$section = PREFIX . 'logo-section';
$sections[] = array(
'id' => $section,
'title' => __('Logo', 'avish'),
'priority' => 30,
'panel' => $header_panel
);
$options[PREFIX . 'logo'] = array(
'id' => PREFIX . 'logo',
'label' => __('Regular Logo', 'avish'),
'section' => $section,
'type' => 'media',
'default' => ''
);
// Header Style
$section = PREFIX . 'header-section';
$sections[] = array(
'id' => $section,
'title' => __('Header Style', 'avish'),
'description' => __('Choose header style', 'avish'),
'priority' => 35,
'panel' => $header_panel
);
$options[PREFIX . 'header-style'] = array(
'id' => PREFIX . 'header-style',
'label' => __('Header Style', 'avish'),
'section' => $section,
'type' => 'radio',
'default' => 'header',
'choices' => array(
'header' => __('Center', 'avish'),
'header2' => __('With Ads', 'avish')
)
);
// Secondary Menu Style
$section = PREFIX . 'menu-section';
$sections[] = array(
'id' => $section,
'title' => __('Secondary Menu Style', 'avish'),
'description' => __('Choose secondary menu style', 'avish'),
'priority' => 35,
'panel' => $header_panel
);
$options[PREFIX . 'menu-style'] = array(
'id' => PREFIX . 'menu-style',
'label' => __('Secondary Menu Style', 'avish'),
'section' => $section,
'type' => 'radio',
'default' => 'secondary-bar1',
'choices' => array(
'secondary-bar1' => __('With Search Form', 'avish'),
'secondary-bar2' => __('Center without Search Form', 'avish')
)
);
// Search icon and form
$section = PREFIX . 'search-section';
$sections[] = array(
'id' => $section,
'title' => __('Search', 'avish'),
'description' => __('Show search icon and form', 'avish'),
'priority' => 40,
'panel' => $header_panel
);
$options[PREFIX . 'search-header'] = array(
'id' => PREFIX . 'search-header',
'label' => '',
'section' => $section,
'type' => 'switch',
'default' => 1
);
// Loop Title
$section = PREFIX . 'title-section';
$sections[] = array(
'id' => $section,
'title' => __('Title', 'avish'),
'description' => __('Display Title and Subtitle', 'avish'),
'priority' => 50,
'panel' => $header_panel
);
$options[PREFIX . 'loop-title'] = array(
'id' => PREFIX . 'loop-title',
'label' => __('Title', 'avish'),
'section' => $section,
'type' => 'text',
'default' => __("What's New?", 'avish')
);
$options[PREFIX . 'loop-description'] = array(
'id' => PREFIX . 'loop-description',
'label' => __('Subtitle/Description', 'avish'),
'section' => $section,
'type' => 'textarea',
'default' => __('Browse our latest posts below or subscribe to our newsletter', 'avish')
);
// Colors Panel and Sections
$color_panel = 'color';
$panels[] = array(
'id' => $color_panel,
'title' => __('Color', 'avish'),
'description' => __('This panel is used for managing colors of your site.', 'avish'),
'priority' => 20
);
// Header background color
$section = PREFIX . 'header-bg-section';
$sections[] = array(
'id' => $section,
'title' => __('Header', 'avish'),
'priority' => 5,
'panel' => $color_panel
);
// $options[PREFIX . 'header-color'] = array(
// 'id' => PREFIX . 'header-color',
// 'label' => __( 'Background color', 'avish' ),
// 'section' => $section,
// 'type' => 'color',
// 'default' => '#141414',
// 'transport' => 'postMessage'
// );
$options[PREFIX . 'site-title-color'] = array(
'id' => PREFIX . 'site-title-color',
'label' => __('Site Title', 'avish'),
'section' => $section,
'type' => 'color',
'default' => '#333333',
'transport' => 'postMessage'
);
// Typography Panel and Sections
$typo_panel = 'typography';
$panels[] = array(
'id' => $typo_panel,
'title' => __('Typography', 'avish'),
'description' => __('This panel is used for managing typography of your site.', 'avish'),
'priority' => 30
);
// Global typography
$section = PREFIX . 'global-typography';
$font_choices = customizer_library_get_font_choices();
$sections[] = array(
'id' => $section,
'title' => __('Global', 'avish'),
'priority' => 5,
'panel' => $typo_panel
);
$options[PREFIX . 'text-font'] = array(
'id' => PREFIX . 'text-font',
'label' => __('Text font', 'avish'),
'section' => $section,
'type' => 'select2',
'choices' => $font_choices,
'default' => 'Roboto',
);
$options[PREFIX . 'heading-font'] = array(
'id' => PREFIX . 'heading-font',
'label' => __('Heading font', 'avish'),
'section' => $section,
'type' => 'select2',
'choices' => $font_choices,
'default' => 'Roboto',
);
// Content Panel and Sections
$content_panel = 'layouts';
$panels[] = array(
'id' => $content_panel,
'title' => __('Layouts', 'avish'),
'description' => __('This panel is used for managing several custom features/layouts of your site.', 'avish'),
'priority' => 35
);
// Featured posts
$section = PREFIX . 'featured-section';
$sections[] = array(
'id' => $section,
'title' => __('Featured Posts', 'avish'),
'priority' => 10,
'panel' => $content_panel
);
$options[PREFIX . 'featured-enable'] = array(
'id' => PREFIX . 'featured-enable',
'label' => __('Show featured posts', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'featured-tag'] = array(
'id' => PREFIX . 'featured-tag',
'label' => __('Select a tag', 'avish'),
'section' => $section,
'type' => 'select2',
'choices' => avish_tags_list()
);
$options[PREFIX . 'featured-num'] = array(
'id' => PREFIX . 'featured-num',
'label' => __('Number of posts', 'avish'),
'section' => $section,
'type' => 'text',
'default' => 6
);
$options[PREFIX . 'featured-orderby'] = array(
'id' => PREFIX . 'featured-orderby',
'label' => __('Order by', 'avish'),
'section' => $section,
'type' => 'select',
'default' => 'date',
'choices' => array(
'date' => __('Date', 'avish'),
'rand' => __('Random', 'avish')
)
);
// Archive layout
$section = PREFIX . 'archive-section';
$sections[] = array(
'id' => $section,
'title' => __('Archive', 'avish'),
'description' => __('Applied to index/archive pages including category, tag, author and search pages', 'avish'),
'priority' => 20,
'panel' => $content_panel
);
$options[PREFIX . 'archive-layout'] = array(
'id' => PREFIX . 'archive-layout',
'label' => __('Archive Layout', 'avish'),
'section' => $section,
'type' => 'radio',
'default' => 'three-columns',
'choices' => array(
'four-columns' => __('4 Columns', 'avish'),
'three-columns' => __('3 Columns', 'avish'),
'two-columns' => __('2 Columns', 'avish'),
'one-column' => __('1 Column', 'avish')
)
);
$options[PREFIX . 'archive-width'] = array(
'id' => PREFIX . 'archive-width',
'label' => __('Grid Width', 'avish'),
'description' => __('Allow custom width per post', 'avish'),
'section' => $section,
'type' => 'radio',
'default' => 'default',
'choices' => array(
'default' => __('Default', 'avish'),
'width2' => __('Custom', 'avish'),
)
);
$options[PREFIX . 'archive-nav'] = array(
'id' => PREFIX . 'archive-nav',
'label' => __('Use Infinite Scroll', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
// Posts
$section = PREFIX . 'posts-section';
$sections[] = array(
'id' => $section,
'title' => __('Posts', 'avish'),
'description' => __('Posts is a single post page.', 'avish'),
'priority' => 30,
'panel' => $content_panel
);
$options[PREFIX . 'post-meta-group'] = array(
'id' => PREFIX . 'post-meta-group',
'label' => __('Post Header', 'avish'),
'section' => $section,
'type' => 'group-title'
);
$options[PREFIX . 'post-thumbnail'] = array(
'id' => PREFIX . 'post-thumbnail',
'label' => __('Show featured image', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'post-date'] = array(
'id' => PREFIX . 'post-date',
'label' => __('Show post date', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'post-author'] = array(
'id' => PREFIX . 'post-author',
'label' => __('Show post author name', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'post-like'] = array(
'id' => PREFIX . 'post-like',
'label' => __('Show post like', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'post-comment'] = array(
'id' => PREFIX . 'post-comment',
'label' => __('Show comment count', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'post-footer-group'] = array(
'id' => PREFIX . 'post-footer-group',
'label' => __('Post Footer', 'avish'),
'section' => $section,
'type' => 'group-title'
);
$options[PREFIX . 'post-cat'] = array(
'id' => PREFIX . 'post-cat',
'label' => __('Show post categories', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'post-tag'] = array(
'id' => PREFIX . 'post-tag',
'label' => __('Show post tags', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'post-share'] = array(
'id' => PREFIX . 'post-share',
'label' => __('Show post share', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'post-nav'] = array(
'id' => PREFIX . 'post-nav',
'label' => __('Show post navigation', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
$options[PREFIX . 'related-posts'] = array(
'id' => PREFIX . 'related-posts',
'label' => __('Show author box and related posts', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
// Page
$section = PREFIX . 'page-section';
$sections[] = array(
'id' => $section,
'title' => __('Page', 'avish'),
'priority' => 40,
'panel' => $content_panel
);
$options[PREFIX . 'page-title'] = array(
'id' => PREFIX . 'page-title',
'label' => __('Show page title', 'avish'),
'section' => $section,
'type' => 'switch',
'default' => 1
);
// Advertisement Panel and Sections
$ads_panel = 'advertisement';
$panels[] = array(
'id' => $ads_panel,
'title' => __('Advertisement', 'avish'),
'priority' => 45
);
// Header ads
$section = PREFIX . 'header-ads-section';
$sections[] = array(
'id' => $section,
'title' => __('Header', 'avish'),
'priority' => 5,
'panel' => $ads_panel,
);
$options[PREFIX . 'header-ads-image'] = array(
'id' => PREFIX . 'header-ads-image',
'label' => __('Ads Image', 'avish'),
'description' => __('Upload your ads image then put the url in the setting below.', 'avish'),
'section' => $section,
'type' => 'media',
'default' => '',
);
$options[PREFIX . 'header-ads-url'] = array(
'id' => PREFIX . 'header-ads-url',
'label' => __('Ads URL', 'avish'),
'description' => __('Put the ads url in the box below.', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'header-ads-custom'] = array(
'id' => PREFIX . 'header-ads-custom',
'label' => __('Or', 'avish'),
'description' => __('Pur you custom ads code (eg. adsense) in the box below.', 'avish'),
'section' => $section,
'type' => 'textarea',
'sanitize_callback' => 'avish_textarea_stripslashes',
'default' => ''
);
// Posts ads
$section = PREFIX . 'posts-ads-section';
$sections[] = array(
'id' => $section,
'title' => __('Posts', 'avish'),
'description' => __('Single post advertisement', 'avish'),
'priority' => 10,
'panel' => $ads_panel,
);
$options[PREFIX . 'post-ads-before'] = array(
'id' => PREFIX . 'post-ads-before',
'label' => __('Ads Before Content', 'avish'),
'section' => $section,
'type' => 'group-title'
);
$options[PREFIX . 'post-ads-image-before'] = array(
'id' => PREFIX . 'post-ads-image-before',
'label' => __('Ads Image', 'avish'),
'description' => __('Upload your ads image then put the url in the setting below.', 'avish'),
'section' => $section,
'type' => 'media',
'default' => '',
);
$options[PREFIX . 'post-ads-url-before'] = array(
'id' => PREFIX . 'post-ads-url-before',
'label' => __('Ads URL', 'avish'),
'description' => __('Put the ads url in the box below.', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'post-ads-custom-before'] = array(
'id' => PREFIX . 'post-ads-custom-before',
'label' => __('Or', 'avish'),
'description' => __('Pur you custom ads code (eg. adsense) in the box below.', 'avish'),
'section' => $section,
'type' => 'textarea',
'sanitize_callback' => 'avish_textarea_stripslashes',
'default' => ''
);
$options[PREFIX . 'post-ads-after'] = array(
'id' => PREFIX . 'post-ads-after',
'label' => __('Ads After Content', 'avish'),
'section' => $section,
'type' => 'group-title'
);
$options[PREFIX . 'post-ads-image-after'] = array(
'id' => PREFIX . 'post-ads-image-after',
'label' => __('Ads Image', 'avish'),
'description' => __('Upload your ads image then put the url in the setting below.', 'avish'),
'section' => $section,
'type' => 'media',
'default' => '',
);
$options[PREFIX . 'post-ads-url-after'] = array(
'id' => PREFIX . 'post-ads-url-after',
'label' => __('Ads URL', 'avish'),
'description' => __('Put the ads url in the box below.', 'avish'),
'section' => $section,
'type' => 'url',
'default' => ''
);
$options[PREFIX . 'post-ads-custom-after'] = array(
'id' => PREFIX . 'post-ads-custom-after',
'label' => __('Or', 'avish'),
'description' => __('Pur you custom ads code (eg. adsense) in the box below.', 'avish'),
'section' => $section,
'type' => 'textarea',
'sanitize_callback' => 'avish_textarea_stripslashes',
'default' => ''
);
// Adds the sections to the $options array
$options['sections'] = $sections;
// Adds the panels to the $options array
$options['panels'] = $panels;
$customizer_library = Customizer_Library::Instance();
$customizer_library->add_options($options);
}
add_action('init', 'avish_customizer_register');