add_section( 'blograzzi-general-header', array( 'title' => __( 'Header', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[hide_top_bar]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-header', 'label' => __( 'Disable Top Bar', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[light_header]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-header', 'label' => __( 'Use light-coloured header bars', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[link_header_img]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-header', 'label' => __( 'Link header image to front page', 'blograzzi' ), 'description' => __( 'Check this if you disable the header texts and want the header image to be linked to the front page.', 'blograzzi' ) ) ); $wp_customize->add_control( 'blograzzi_settings[featured_img_header]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-header', 'label' => __( 'Disable Featured Image replacing header image', 'blograzzi' ), 'description' => __( 'Check this to prevent the posts Featured Image replacing the header image regardless of the featured image dimension.', 'blograzzi' ) ) ); $wp_customize->add_control( new Blograzzi_Enhanced_Text_Control( $wp_customize, 'blograzzi_settings[header_img_height]', array( 'type' => 'number', 'section' => 'blograzzi-general-header', 'label' => __( 'Header image max height', 'blograzzi' ), 'unit' => 'px', ) ) ); $wp_customize->add_control( 'blograzzi_settings[search_box_location]', array( 'type' => 'radio', 'section' => 'blograzzi-general-header', 'label' => __( 'Search box location', 'blograzzi' ), 'choices' => array( 'top_bar' => __( 'Top bar', 'blograzzi' ), 'nav_bar' => __( 'Navigation bar', 'blograzzi' ), 'disabled' => __( 'Disabled', 'blograzzi' ), ), ) ); /* =Slider --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-slider', array( 'title' => __( 'Slider', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[slider_disable]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-slider', 'label' => __( 'Disable slider', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[slider_full_width]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-slider', 'label' => __( 'Extend slider to full width of theme', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[slider_type]', array( 'type' => 'select', 'section' => 'blograzzi-general-slider', 'label' => __( 'Slider content', 'blograzzi' ), 'choices' => array( 'latest_posts' => __( 'Show latest posts', 'blograzzi' ), 'random' => __( 'Show random posts', 'blograzzi' ), 'posts_pages' => __( 'Show specific posts/pages', 'blograzzi' ), 'categories' => __( 'Show posts from categories', 'blograzzi' ), ), ) ); $wp_customize->add_control( 'blograzzi_settings[slider_with_image_only]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-slider', 'label' => __( 'Include posts with featured image only', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[slider_specific_posts]', array( 'type' => 'text', 'section' => 'blograzzi-general-slider', 'label' => __( 'Posts and/or pages to display', 'blograzzi' ), 'description' => __( 'Enter ID of posts and/or pages to be displayed, separated by comma.
Applicable only if "Show specific posts/pages" is selected above.
Example: 1,13,45,33', 'blograzzi' ) ) ); $cat_choices = array(); $categories = get_categories( array( 'hide_empty' => true ) ); foreach ( $categories as $cat ) $cat_choices[$cat->cat_ID] = $cat->cat_name; $wp_customize->add_control( new Blograzzi_Multiple_Select_Control( $wp_customize, 'blograzzi_settings[slider_specific_categories]', array( 'type' => 'select', 'section' => 'blograzzi-general-slider', 'label' => __( 'Categories to display', 'blograzzi' ), 'multiple' => true, 'choices' => $cat_choices, 'description' => __( 'All posts within the categories selected here will be displayed on the slider. Usage example: create a new category "Featured" and assign all posts to be displayed on the slider to that category, and then select that category here.', 'blograzzi' ), 'input_attrs' => array( 'data-placeholder' => __( 'Select categories', 'blograzzi' ), ) ) ) ); $wp_customize->add_control( 'blograzzi_settings[slider_exclude_categories]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-slider', 'label' => __( 'Exclude the categories from posts listing', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[slider_random_category_posts]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-slider', 'label' => __( 'Show posts from categories in random order', 'blograzzi' ), ) ); $wp_customize->add_control( new Blograzzi_Enhanced_Text_Control( $wp_customize, 'blograzzi_settings[slider_postcount]', array( 'type' => 'number', 'section' => 'blograzzi-general-slider', 'label' => __( 'Number of posts to display', 'blograzzi' ), 'unit' => __( 'posts', 'blograzzi' ), ) ) ); $wp_customize->add_control( 'blograzzi_settings[slider_img]', array( 'type' => 'select', 'section' => 'blograzzi-general-slider', 'label' => __( 'Slider image', 'blograzzi' ), 'choices' => array( 'disabled' => __( "Don't show image", 'blograzzi' ), 'featured_image'=> __( 'Featured image', 'blograzzi' ), 'post_image' => __( 'First image in post', 'blograzzi' ), 'custom_url' => __( 'Custom image', 'blograzzi' ), ), ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'blograzzi_settings[slider_imgurl]', array( 'label' => __( 'Custom slider image', 'blograzzi' ), 'section' => 'blograzzi-general-slider', 'settings' => 'blograzzi_settings[slider_imgurl]', 'description'=> __( 'Make sure you select "Custom image" in the slider image option above to use this image.', 'blograzzi' ) ) ) ); $wp_customize->add_control( 'blograzzi_settings[slider_display_style]', array( 'type' => 'select', 'section' => 'blograzzi-general-slider', 'label' => __( 'Slider display style', 'blograzzi' ), 'choices' => array( 'bgimage-excerpt' => __( 'Background image and excerpt', 'blograzzi' ), 'full-post' => __( 'Full post content', 'blograzzi' ), ), ) ); $wp_customize->add_control( new Blograzzi_Enhanced_Text_Control( $wp_customize, 'blograzzi_settings[slider_height]', array( 'type' => 'number', 'section' => 'blograzzi-general-slider', 'label' => __( 'Slider height', 'blograzzi' ), 'unit' => __( 'px', 'blograzzi' ), ) ) ); $wp_customize->add_control( new Blograzzi_Enhanced_Text_Control( $wp_customize, 'blograzzi_settings[slider_height_mobile]', array( 'type' => 'number', 'section' => 'blograzzi-general-slider', 'label' => __( 'Slider height (mobile)', 'blograzzi' ), 'unit' => __( 'px', 'blograzzi' ), ) ) ); $wp_customize->add_control( new Blograzzi_Enhanced_Text_Control( $wp_customize, 'blograzzi_settings[slider_speed]', array( 'type' => 'number', 'section' => 'blograzzi-general-slider', 'label' => __( 'Slider speed', 'blograzzi' ), 'unit' => __( 'milliseconds', 'blograzzi' ), 'description' => __( 'This is the duration that each slider item will be shown.', 'blograzzi' ) ) ) ); $wp_customize->add_control( 'blograzzi_settings[slider_position]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-slider', 'label' => __( 'Move slider to bottom of page', 'blograzzi' ), ) ); /* =Infinite Scroll --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-infinite-scroll', array( 'title' => __( 'Infinite Scroll', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[inf_scroll_enable]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-infinite-scroll', 'label' => __( 'Enable for posts', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[inf_scroll_comments]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-infinite-scroll', 'label' => __( 'Enable for comments', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[inf_scroll_method]', array( 'type' => 'radio', 'section' => 'blograzzi-general-infinite-scroll', 'label' => __( 'Loading method', 'blograzzi' ), 'choices' => array( 'auto' => __( 'Auto-load', 'blograzzi' ), 'click' => __( 'Click-to-load', 'blograzzi' ), ), ) ); /* =Front Page --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-front-page', array( 'title' => __( 'Front Page', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( new Blograzzi_Multiple_Select_Control( $wp_customize, 'blograzzi_settings[frontpage_posts_cats]', array( 'type' => 'select', 'section' => 'blograzzi-general-front-page', 'label' => __( 'Front page posts categories', 'blograzzi' ), 'multiple' => true, 'choices' => $cat_choices, 'description' => __( 'Only posts that belong to the categories selected here will be displayed on the front page. Works only if not using Static Front Page.', 'blograzzi' ), 'input_attrs' => array( 'data-placeholder' => __( 'Select categories', 'blograzzi' ), ) ) ) ); /* =Home Page Panes --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-home-page-panes', array( 'title' => __( 'Home Page Panes', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[disable_homepage_panes]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-home-page-panes', 'label' => __( 'Disable homepage panes', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[show_post_type]', array( 'type' => 'select', 'section' => 'blograzzi-general-home-page-panes', 'label' => __( 'Type of content to show', 'blograzzi' ), 'choices' => array( 'latest-posts' => __( 'Latest posts', 'blograzzi' ), 'posts' => __( 'Show specific posts/pages', 'blograzzi' ), ), ) ); $wp_customize->add_control( 'blograzzi_settings[homepage_panes_count]', array( 'type' => 'number', 'section' => 'blograzzi-general-home-page-panes', 'label' => __( 'Number of posts', 'blograzzi' ), ) ); $wp_customize->add_control( new Blograzzi_Multiple_Select_Control( $wp_customize, 'blograzzi_settings[homepage_panes_cat]', array( 'type' => 'select', 'section' => 'blograzzi-general-home-page-panes', 'label' => __( 'Categories to show latest posts from', 'blograzzi' ), 'multiple' => true, 'choices' => $cat_choices, 'description' => __( 'Only posts that belong to the categories selected here will be displayed in the home page panes.', 'blograzzi' ), 'input_attrs' => array( 'data-placeholder' => __( 'Select categories', 'blograzzi' ), ) ) ) ); $wp_customize->add_control( 'blograzzi_settings[homepage_panes_posts]', array( 'type' => 'text', 'section' => 'blograzzi-general-home-page-panes', 'label' => __( 'Posts and/or pages to display', 'blograzzi' ), 'description' => __( 'Enter ID of posts and/or pages to be displayed, separated by comma.
Applicable only if "Show specific posts/pages" is selected above.
Example: 1,13,45,33', 'blograzzi' ) ) ); /* =Comments --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-comments', array( 'title' => __( 'Comments', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[comments_setting]', array( 'type' => 'select', 'section' => 'blograzzi-general-comments', 'label' => __( 'Commenting', 'blograzzi' ), 'description' => __( 'Overrides the global WordPress Discussion Setting called "Allow people to post comments on new articles" and also the "Allow comments" option for individual posts/pages.', 'blograzzi' ), 'choices' => array( 'wordpress' => __( 'Use WordPress settings', 'blograzzi' ), 'disabled_pages' => __( 'Disable for pages', 'blograzzi' ), 'disabled_completely' => __( 'Disable completely', 'blograzzi' ), ), ) ); /* =Child pages --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-child-pages', array( 'title' => __( 'Child Pages', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[hide_parent_content_if_empty]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-child-pages', 'label' => __( 'Hide parent box if content is empty', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[disable_child_pages_nav]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-child-pages', 'label' => __( 'Disable contextual navigation in the sidebar', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[child_page_listing]', array( 'type' => 'select', 'section' => 'blograzzi-general-child-pages', 'label' => __( 'Child page listings', 'blograzzi' ), 'choices' => array( 'show_always' => __( 'Show listing', 'blograzzi' ), 'hode' => __( 'Hide listing', 'blograzzi' ), 'show_if_parent_empty' => __( 'Show only if parent is empty', 'blograzzi' ), ), ) ); /* =Widget Area --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-widget-areas', array( 'title' => __( 'Widget Areas', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[enable_header_widget]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-widget-areas', 'label' => __( 'Enable header widget area', 'blograzzi' ), 'description' => __( 'Important: This widget area is unstyled, as it is often used for advertisement banners, etc. If you enable it, make sure you style it to your needs using the Custom CSS option.', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[alt_home_sidebar]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-widget-areas', 'label' => __( 'Enable alternative sidebar widget area in front page.', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[alt_home_footerwidget]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-widget-areas', 'label' => __( 'Enable alternative footer widget area in front page.', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[footerwidget_column]', array( 'type' => 'text', 'section' => 'blograzzi-general-widget-areas', 'label' => __( 'Divide footer widget area into this number of columns', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[alt_footerwidget_column]', array( 'type' => 'text', 'section' => 'blograzzi-general-widget-areas', 'label' => __( 'Divide alternative footer widget area into this number of columns', 'blograzzi' ), ) ); /* =Social Profiles --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-social-profiles', array( 'title' => __( 'Social Profiles', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[social_media_new_window]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-social-profiles', 'label' => __( 'Open social media links in new window', 'blograzzi' ), ) ); $wp_customize->add_control( new Blograzzi_Social_Profiles_Control( $wp_customize, 'blograzzi_settings[social_profiles]', array( 'section' => 'blograzzi-general-social-profiles', 'label' => __( 'Social profiles', 'blograzzi' ), ) ) ); /* =Social Sharing --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-social', array( 'title' => __( 'Social Sharing', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[show_addthis]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-social', 'label' => __( 'Show social sharing buttons', 'blograzzi' ) ) ); $wp_customize->add_control( 'blograzzi_settings[show_addthis_page]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-social', 'label' => __( 'Include static Pages', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[show_addthis_archive]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-social', 'label' => __( 'Include home and archive pages', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[addthis_location]', array( 'type' => 'select', 'section' => 'blograzzi-general-social', 'label' => __( 'Buttons location', 'blograzzi' ), 'choices' => array( 'post-bottom' => __( 'Bottom of posts', 'blograzzi' ), 'post-top' => __( 'Top of posts', 'blograzzi' ), 'top-bottom' => __( 'Top and bottom of posts', 'blograzzi' ), ), ) ); $wp_customize->add_control( new Blograzzi_Code_Control( $wp_customize, 'blograzzi_settings[addthis_code]', array( 'type' => 'textarea', 'section' => 'blograzzi-general-social', 'label' => __( 'Social sharing buttons code', 'blograzzi' ), 'description' => __( 'You can use codes from any popular social sharing sites, like Facebook, Digg, AddThis, etc.', 'blograzzi' ), 'input_attrs' => array( 'rows' => 3, 'cols' => 60 ) ) ) ); /* =Adsense --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-adsense', array( 'title' => __( 'Ads', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[show_adsense]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-adsense', 'label' => __( 'Show ads', 'blograzzi' ) ) ); $wp_customize->add_control( 'blograzzi_settings[adsense_show_frontpage]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-adsense', 'label' => __( 'Include Front Page', 'blograzzi' ) ) ); $wp_customize->add_control( new Blograzzi_Code_Control( $wp_customize, 'blograzzi_settings[adsense_code]', array( 'type' => 'textarea', 'section' => 'blograzzi-general-adsense', 'label' => __( 'Ads code', 'blograzzi' ), 'input_attrs' => array( 'rows' => 3, 'cols' => 60 ) ) ) ); /* =Analytics --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-analytics', array( 'title' => __( 'Analytics', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[show_ga]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-analytics', 'label' => __( 'Enable analytics tracking', 'blograzzi' ) ) ); $wp_customize->add_control( new Blograzzi_Code_Control( $wp_customize, 'blograzzi_settings[ga_code]', array( 'type' => 'textarea', 'section' => 'blograzzi-general-analytics', 'label' => __( 'Analytics code', 'blograzzi' ), 'description' => sprintf( __( 'The analytics code will be added inside the %s element of all pages in this site.', 'blograzzi' ), '<head>' ), 'input_attrs' => array( 'rows' => 3, 'cols' => 60 ) ) ) ); /* =Footer --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-footer', array( 'title' => __( 'Footer', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( new Blograzzi_Code_Control( $wp_customize, 'blograzzi_settings[copy_text]', array( 'type' => 'textarea', 'section' => 'blograzzi-general-footer', 'label' => __( 'Copyright text (html allowed)', 'blograzzi' ), 'input_attrs' => array( 'rows' => 3, 'cols' => 60 ) ) ) ); $wp_customize->add_control( 'blograzzi_settings[hide_copyright]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-footer', 'label' => __( 'Do not show copyright info', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[hide_return_top]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-footer', 'label' => __( 'Disable "Return to top" button', 'blograzzi' ), ) ); /* =Print --------------------------------------------------------------------------------------*/ $wp_customize->add_section( 'blograzzi-general-print', array( 'title' => __( 'Print', 'blograzzi' ), 'panel' => 'blograzzi-general', ) ); $wp_customize->add_control( 'blograzzi_settings[print_css]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-print', 'label' => __( 'Clean up single posts and pages when printing', 'blograzzi' ), ) ); $wp_customize->add_control( 'blograzzi_settings[print_button]', array( 'type' => 'checkbox', 'section' => 'blograzzi-general-print', 'label' => __( 'Show print button', 'blograzzi' ), ) ); }