add_panel('a_anglo_them_option_panel', array( 'title' => 'Theme Options', 'priority' => '200', 'description' => ' this is a customize theme options panel' ) ); } add_action( 'customize_register', 'a_anglo_panel_customize_register' ); /** * @param $wp_customize * social links section */ function a_anglo_social_links_customize_register($wp_customize){ $wp_customize->add_section( 'social_links', array( 'title' => __( 'Social links', 'aanglo' ), 'priority' => 5, 'description' => __( 'Header and Footer social links', 'aanglo' ), 'panel' => 'a_anglo_them_option_panel', ) ); //add setting $wp_customize->add_setting( 'hide_social_links', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'hide_social_links', array( 'label' => 'Hide Social links', 'type' => 'checkbox', 'section' => 'social_links', 'settings' => 'hide_social_links' ) ); $wp_customize->add_setting( 'facebook_default_link', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'facebook_default_link', array( 'section' => 'social_links', 'label' => 'Facebook link', 'type' => 'text' ) ); $wp_customize->add_setting( 'twitter_default_link', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'twitter_default_link', array( 'section' => 'social_links', 'label' => 'Twitter link', 'type' => 'text' ) ); $wp_customize->add_setting( 'pinterest_default_link', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'pinterest_default_link', array( 'section' => 'social_links', 'label' => 'Pinterest link', 'type' => 'text' ) ); $wp_customize->add_setting( 'vimeo_default_link', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'vimeo_default_link', array( 'section' => 'social_links', 'label' => 'Vimeo link', 'type' => 'text' ) ); $wp_customize->add_setting( 'flickr_default_link', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'flickr_default_link', array( 'section' => 'social_links', 'label' => 'Flickr link', 'type' => 'text' ) ); } add_action( 'customize_register', 'a_anglo_social_links_customize_register' ); /** * @param $wp_customize * Header section */ function a_anglo_header_section_customize_register( $wp_customize ){ $wp_customize->add_section( 'header_section', array( 'title' => __( 'Header section', 'aanglo' ), 'priority' => 6, 'description' => __( 'Header section', 'aanglo' ), 'panel' => 'a_anglo_them_option_panel', ) ); //add setting $wp_customize->add_setting( 'hide_cart_icon', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'hide_cart_icon', array( 'label' => 'Hide cart icon', 'type' => 'checkbox', 'section' => 'header_section', 'settings' => 'hide_cart_icon' ) ); //add setting $wp_customize->add_setting( 'hide_search', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'hide_search', array( 'label' => 'Hide search', 'type' => 'checkbox', 'section' => 'header_section', 'settings' => 'hide_search' ) ); } add_action( 'customize_register', 'a_anglo_header_section_customize_register' ); /** * @param $wp_customize * newsletter section */ function a_anglo_newsletter_section_customize_register( $wp_customize ){ $wp_customize->add_section( 'newsletter_section', array( 'title' => __( 'Newsletter', 'aanglo' ), 'priority' => 6, 'description' => __( 'Newsletter section', 'aanglo' ), 'panel' => 'a_anglo_them_option_panel', ) ); //add setting $wp_customize->add_setting( 'show_newsletter_sec', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'show_newsletter_sec', array( 'label' => 'Show Newsletter', 'type' => 'checkbox', 'section' => 'newsletter_section', 'settings' => 'show_newsletter_sec' ) ); //add setting $wp_customize->add_setting( 'newsletter_cf_short_code', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'newsletter_cf_short_code', array( 'label' => 'Add Contact form 7 ShortCode', 'type' => 'text', 'section' => 'newsletter_section', 'settings' => 'newsletter_cf_short_code' ) ); } add_action( 'customize_register', 'a_anglo_newsletter_section_customize_register' ); /** * @param $wp_customize * newsletter section */ function a_anglo_instagram_section_customize_register( $wp_customize ){ $wp_customize->add_section( 'instagram_section', array( 'title' => __( 'Instagram', 'aanglo' ), 'priority' => 7, 'description' => __( 'Instagram section', 'aanglo' ), 'panel' => 'a_anglo_them_option_panel', ) ); //add setting $wp_customize->add_setting( 'show_instagram_sec', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'show_instagram_sec', array( 'label' => 'Show Instagram Feed', 'type' => 'checkbox', 'section' => 'instagram_section', 'settings' => 'show_instagram_sec' ) ); //add setting $wp_customize->add_setting( 'instagram_title', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'instagram_title', array( 'label' => 'Instagram title display', 'type' => 'text', 'section' => 'instagram_section', 'settings' => 'instagram_title' ) ); //add setting $wp_customize->add_setting( 'instagram_name', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'instagram_name', array( 'label' => 'Instagram name display', 'type' => 'text', 'section' => 'instagram_section', 'settings' => 'instagram_name' ) ); //add setting $wp_customize->add_setting( 'instagram_user_id', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'instagram_user_id', array( 'label' => 'Instagram User ID', 'type' => 'text', 'section' => 'instagram_section', 'settings' => 'instagram_user_id' ) ); //add setting $wp_customize->add_setting( 'instagram_access_tocken_id', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'instagram_access_tocken_id', array( 'label' => 'Instagram Access Tocken', 'type' => 'text', 'section' => 'instagram_section', 'settings' => 'instagram_access_tocken_id' ) ); //add setting $wp_customize->add_setting( 'show_fake_instagram_sec', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'show_fake_instagram_sec', array( 'label' => 'Show Fake Instagram Feed', 'type' => 'checkbox', 'section' => 'instagram_section', 'settings' => 'show_fake_instagram_sec' ) ); $wp_customize->add_setting('fake_instagram_image_1', array( 'default' => '', 'type' => 'theme_mod', 'sanitize_callback' => 'a_anglo_customize_sanitize_footer_image', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'fake_instagram_image_1', array( 'label' => 'fake instagram image 1', 'settings' => 'fake_instagram_image_1', 'section' => 'instagram_section', 'priority' => 10, ) ) ); $wp_customize->add_setting('fake_instagram_image_2', array( 'default' => '', 'type' => 'theme_mod', 'sanitize_callback' => 'a_anglo_customize_sanitize_footer_image', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'fake_instagram_image_2', array( 'label' => 'fake instagram image 2', 'settings' => 'fake_instagram_image_2', 'section' => 'instagram_section', 'priority' => 11, ) ) ); $wp_customize->add_setting('fake_instagram_image_3', array( 'default' => '', 'type' => 'theme_mod', 'sanitize_callback' => 'a_anglo_customize_sanitize_footer_image', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'fake_instagram_image_3', array( 'label' => 'fake instagram image 3', 'settings' => 'fake_instagram_image_3', 'section' => 'instagram_section', 'priority' => 12, ) ) ); $wp_customize->add_setting('fake_instagram_image_4', array( 'default' => '', 'type' => 'theme_mod', 'sanitize_callback' => 'a_anglo_customize_sanitize_footer_image', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'fake_instagram_image_4', array( 'label' => 'fake instagram image 4', 'settings' => 'fake_instagram_image_4', 'section' => 'instagram_section', 'priority' => 13, ) ) ); $wp_customize->add_setting('fake_instagram_image_5', array( 'default' => '', 'type' => 'theme_mod', 'sanitize_callback' => 'a_anglo_customize_sanitize_footer_image', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'fake_instagram_image_5', array( 'label' => 'fake instagram image 5', 'settings' => 'fake_instagram_image_5', 'section' => 'instagram_section', 'priority' => 14, ) ) ); $wp_customize->add_setting('fake_instagram_image_6', array( 'default' => '', 'type' => 'theme_mod', 'sanitize_callback' => 'a_anglo_customize_sanitize_footer_image', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'fake_instagram_image_6', array( 'label' => 'fake instagram image 6', 'settings' => 'fake_instagram_image_6', 'section' => 'instagram_section', 'priority' => 16, ) ) ); } add_action( 'customize_register', 'a_anglo_instagram_section_customize_register' ); /** * @param $wp_customize * footer section */ function a_anglo_footer_section_customize_register( $wp_customize ){ $wp_customize->add_section( 'footer_section', array( 'title' => __( 'Footer', 'aanglo' ), 'priority' => 7, 'description' => __( 'Footer section', 'aanglo' ), 'panel' => 'a_anglo_them_option_panel', ) ); //add setting $wp_customize->add_setting( 'footer_logo', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); $wp_customize->add_setting( 'footer_copyright_text', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'footer_copyright_text', array( 'section' => 'footer_section', 'label' => 'Footer copyright text', 'type' => 'text', 'priority' => 4, ) ); $wp_customize->add_setting('footer_logo', array( 'default' => '', 'type' => 'theme_mod', 'sanitize_callback' => 'a_anglo_customize_sanitize_footer_image', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'my_footer_image', array( 'label' => 'Footer logo', 'settings' => 'footer_logo', 'section' => 'footer_section', 'priority' => 3, ) ) ); } add_action( 'customize_register', 'a_anglo_footer_section_customize_register' ); /** * Sanitize footer image * * @param $input * * @return string */ function a_anglo_customize_sanitize_footer_image($input) { return attachment_url_to_postid($input); } /** * @param $wp_customize * blog page style */ function blog_page_style_customize_register( $wp_customize ){ $wp_customize->add_section( 'blog_page_style', array( 'title' => __( 'Blog page', 'aanglo' ), 'priority' => 30, 'description' => __( 'Blog page style', 'aanglo' ), 'panel' => 'a_anglo_them_option_panel', ) ); //add setting $wp_customize->add_setting( 'blog_page_stl', array( 'default' => 'default', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_addsetting_field', ) ); //add control $wp_customize->add_control( 'blog_page_stl', array( 'label' => 'Select blog style', 'section' => 'blog_page_style', 'settings' => 'blog_page_stl', 'type' => 'select', 'priority' => 18, 'choices' => array( 'default' => 'Default', 'list' => 'List style', 'masonry' => 'Masonry', ), ) ); //add setting $wp_customize->add_setting( 'blog_page_sidebar', array( 'default' => 'right', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_addsetting_field', ) ); //add control $wp_customize->add_control( 'blog_page_sidebar', array( 'label' => 'Select blog sidebar position', 'section' => 'blog_page_style', 'settings' => 'blog_page_sidebar', 'type' => 'select', 'priority' => 19, 'choices' => array( 'right' => 'Right sidebar', 'left' => 'Left sidebar', ), ) ); } add_action( 'customize_register', 'blog_page_style_customize_register' ); /** * @param $wp_customize * blog single page style */ function blog_single_page_style_customize_register( $wp_customize ){ $wp_customize->add_section( 'blog_single_page_style', array( 'title' => __( 'Blog single page', 'aanglo' ), 'priority' => 32, 'description' => __( 'Blog single page style', 'aanglo' ), 'panel' => 'a_anglo_them_option_panel', ) ); //add setting $wp_customize->add_setting( 'blog_single_page_sidebar', array( 'default' => 'right', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_addsetting_field', ) ); //add control $wp_customize->add_control( 'blog_single_page_sidebar', array( 'label' => 'Select blog sidebar position', 'section' => 'blog_single_page_style', 'settings' => 'blog_single_page_sidebar', 'type' => 'select', 'priority' => 22, 'choices' => array( 'right' => 'Right sidebar', 'left' => 'Left sidebar', 'fullwidth' => 'Full width', ), ) ); //add setting $wp_customize->add_setting( 'show_social_share', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'show_social_share', array( 'label' => 'Show Social share', 'type' => 'checkbox', 'section' => 'blog_single_page_style', 'settings' => 'show_social_share' ) ); //add setting $wp_customize->add_setting( 'show_user_social_links', array( 'default' => '', 'sanitize_callback' => 'sanitize_addsetting_field', 'transport' => 'refresh' ) ); //add control $wp_customize->add_control( 'show_user_social_links', array( 'label' => 'Show author social links', 'type' => 'checkbox', 'section' => 'blog_single_page_style', 'settings' => 'show_user_social_links' ) ); } add_action( 'customize_register', 'blog_single_page_style_customize_register' );