add_panel('panel_id',array( 'panel'=>'panel_id', 'title'=>__('Theme Options', 'blogger-spot'), 'priority'=>20, )); // Theme Settings - Header Banner Text $wp_customize->add_section( 'header_section' , array( 'panel' => 'panel_id', 'title' => __( 'Header Banner Text', 'blogger-spot' ), 'priority' => 10, ) ); // Theme Settings - Footer Copyright Text $wp_customize->add_section('footer_section', array( 'panel' => 'panel_id', 'title' => __('Footer Copyright Text', 'blogger-spot'), 'priority' => 20, )); // Theme Settings - Top Left Text $wp_customize->add_section('top_section', array( 'panel' => 'panel_id', 'title' => __('Top Left Text', 'blogger-spot'), 'priority' => 30, )); // Theme Settings - Social Media Profiles $wp_customize->add_section('social_section', array( 'panel' => 'panel_id', 'title' => __('Social Media Profiles', 'blogger-spot'), 'description' => 'Add your social profile links here. To hide specific social media profile, Keep that blank.', 'priority' => 40, )); // Themes Settings - Related Posts Count $wp_customize->add_section('related_posts_section', array( 'panel' => 'panel_id', 'title' => __('Related Posts Count', 'blogger-spot'), 'description' => 'Enter the number, how many related posts should be shown on post page.', 'priority' => 50, )); // Theme Settings - Header Banner Text // Add setting $wp_customize->add_setting( 'header_text_block', array( 'default' => __( '“I love places that make you realize how tiny you and your problems are.”', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'header_text_block', array( 'label' => __( 'Home Banner Text', 'blogger-spot' ), 'section' => 'header_section', 'settings' => 'header_text_block', 'type' => 'text', 'priority' => 5, ) ) ); // Theme Settings - Footer Copyright Text // Add Setting $wp_customize->add_setting( 'footer_text_block', array( 'default' => __( '© Copyright 2022 Blogger Spot.', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'footer_text_block', array( 'label' => __( 'Footer Text', 'blogger-spot' ), 'section' => 'footer_section', 'settings' => 'footer_text_block', 'type' => 'text', 'priority' => 5, ) ) ); // Theme Settings - Top Left Text // Add Setting $wp_customize->add_setting( 'top_left_text_block', array( 'default' => __( 'Add Your Text Here.', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'top_left_text_block', array( 'label' => __( 'Top Left Text', 'blogger-spot' ), 'section' => 'top_section', 'settings' => 'top_left_text_block', 'type' => 'text', 'priority' => 5, ) ) ); // Social Media - Facebook // Add Setting $wp_customize->add_setting( 'facebook_url', array( 'default' => __( '#', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'facebook_url', array( 'label' => __( 'Facebook', 'blogger-spot' ), 'section' => 'social_section', 'settings' => 'facebook_url', 'type' => 'text', 'priority' => 5, ) ) ); // Social Media - Instagram // Add Setting $wp_customize->add_setting( 'instagram_url', array( 'default' => __( '#', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'instagram_url', array( 'label' => __( 'Instagram', 'blogger-spot' ), 'section' => 'social_section', 'settings' => 'instagram_url', 'type' => 'text', 'priority' => 5, ) ) ); // Social Media - Twitter // Add Setting $wp_customize->add_setting( 'twitter_url', array( 'default' => __( '#', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'twitter_url', array( 'label' => __( 'Twitter', 'blogger-spot' ), 'section' => 'social_section', 'settings' => 'twitter_url', 'type' => 'text', 'priority' => 5, ) ) ); // Social Media - Google Plus // Add Setting $wp_customize->add_setting( 'googleplus_url', array( 'default' => __( '#', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'googleplus_url', array( 'label' => __( 'Google Plus', 'blogger-spot' ), 'section' => 'social_section', 'settings' => 'googleplus_url', 'type' => 'text', 'priority' => 5, ) ) ); // Social Media - YouTube // Add Setting $wp_customize->add_setting( 'youtube_url', array( 'default' => __( '#', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'youtube_url', array( 'label' => __( 'YouTube', 'blogger-spot' ), 'section' => 'social_section', 'settings' => 'youtube_url', 'type' => 'text', 'priority' => 5, ) ) ); // Social Media - LinkedIn // Add Setting $wp_customize->add_setting( 'linkedin_url', array( 'default' => __( '#', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'linkedin_url', array( 'label' => __( 'LinkedIn', 'blogger-spot' ), 'section' => 'social_section', 'settings' => 'linkedin_url', 'type' => 'text', 'priority' => 5, ) ) ); // Social Media - Pinterest // Add Setting $wp_customize->add_setting( 'pinterest_url', array( 'default' => __( '#', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'pinterest_url', array( 'label' => __( 'Pinterest', 'blogger-spot' ), 'section' => 'social_section', 'settings' => 'pinterest_url', 'type' => 'text', 'priority' => 5, ) ) ); // Related Posts Count // Add Setting $wp_customize->add_setting( 'related_posts_setting', array( 'default' => __( '2', 'blogger-spot' ), 'sanitize_callback' => 'sanitize_text' ) ); // Add control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'related_posts_settingg', array( 'label' => __( 'Related Posts Count', 'blogger-spot' ), 'section' => 'related_posts_section', 'settings' => 'related_posts_setting', 'type' => 'select', 'choices' => array( '2' => '2', '4' => '4', '6' => '6', '8' => '8', '10' => '10' ), 'priority' => 5, ) ) ); // Sanitize text function sanitize_text( $text ) { return sanitize_text_field( $text ); } } add_action( 'customize_register', 'blogger_spot_customize_register' ); function home_banner_text() { echo esc_html(get_theme_mod( 'header_text_block','“I love places that make you realize how tiny you and your problems are.”')); } add_action('banner_text', 'home_banner_text'); function footer_copyright_text() { echo esc_html(get_theme_mod('footer_text_block','© Copyright 2022 Blogger Spot.')); } add_action('footer_text','footer_copyright_text'); function top_left_text() { echo esc_html(get_theme_mod('top_left_text_block','Add Your Text Here.')); } add_action('top_left_text','top_left_text'); function facebook_profile() { echo esc_html(get_theme_mod('facebook_url')); } add_action('facebook_profile','facebook_profile'); function instagram_profile() { echo esc_html(get_theme_mod('instagram_url')); } add_action('instagram_profile','instagram_profile'); function twitter_profile() { echo esc_html(get_theme_mod('twitter_url')); } add_action('twitter_profile','twitter_profile'); function googleplus_profile() { echo esc_html(get_theme_mod('googleplus_url')); } add_action('googleplus_profile','gogoleplus_profile'); function youtube_profile() { echo esc_html(get_theme_mod('youtube_url')); } add_action('youtube_profile','youtube_profile'); function linkedin_profile() { echo esc_html(get_theme_mod('linkedin_url')); } add_action('linkedin_profile','linkedin_profile'); function pinterest_profile() { echo esc_html(get_theme_mod('pinterest_url')); } add_action('pinterest_profile','pinterest_profile'); function related_posts() { echo esc_html(get_theme_mod('related_posts_setting')); } add_action('related_posts','related_posts'); ?>