'ffffff', )); add_image_size( 'medical-insight-featured-image', 2000, 1200, true ); add_image_size( 'medical-insight-thumbnail-avatar', 100, 100, true ); $GLOBALS['content_width'] = 525; register_nav_menus( array( 'primary' => __( 'Primary Menu', 'medical-insight' ), ) ); add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', ) ); // Add theme support for Custom Logo. add_theme_support( 'custom-logo', array( 'width' => 250, 'height' => 250, 'flex-width' => true, 'flex-height' => true, ) ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, and column width. */ add_editor_style( array( 'assets/css/editor-style.css', medical_care_fonts_url() ) ); } add_action( 'after_setup_theme', 'medical_insight_setup' ); //widgets function medical_insight_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'medical-insight' ), 'id' => 'sidebar-1', 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'medical-insight' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Page Sidebar', 'medical-insight' ), 'id' => 'sidebar-2', 'description' => __( 'Add widgets here to appear in your pages and posts', 'medical-insight' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Sidebar 3', 'medical-insight' ), 'id' => 'sidebar-3', 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'medical-insight' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 1', 'medical-insight' ), 'id' => 'footer-1', 'description' => __( 'Add widgets here to appear in your footer.', 'medical-insight' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 2', 'medical-insight' ), 'id' => 'footer-2', 'description' => __( 'Add widgets here to appear in your footer.', 'medical-insight' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 3', 'medical-insight' ), 'id' => 'footer-3', 'description' => __( 'Add widgets here to appear in your footer.', 'medical-insight' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 4', 'medical-insight' ), 'id' => 'footer-4', 'description' => __( 'Add widgets here to appear in your footer.', 'medical-insight' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'medical_insight_widgets_init' ); // remove section function medical_insight_customize_register() { global $wp_customize; $wp_customize->remove_section( 'medical_care_header' ); $wp_customize->remove_setting('medical_care_slider_excerpt_show_hide'); $wp_customize->remove_control('medical_care_slider_excerpt_show_hide'); } add_action( 'customize_register', 'medical_insight_customize_register', 11 ); // about customize dropdown function medical_insight_about_dropdown(){ if(get_option('medical_insight_about_show_hide') == true ) { return true; } return false; } // customizer function medical_insight_customize( $wp_customize ) { wp_enqueue_style('customizercustom_css', esc_url( get_stylesheet_directory_uri() ). '/assets/css/customizer.css'); require get_theme_file_path( 'inc/custom-control.php' ); // Social Media $wp_customize->add_section('medical_insight_urls',array( 'title' => __('Social Media', 'medical-insight'), 'panel' => 'medical_care_custompage_panel', 'priority' => 2, ) ); $wp_customize->selective_refresh->add_partial( 'medical_insight_facebook', array( 'selector' => '.links i', 'render_callback' => 'medical_care_customize_partial_medical_insight_facebook', ) ); $wp_customize->add_setting( 'medical_insight_facebook_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Section_Heading( $wp_customize, 'medical_insight_facebook_heading', array( 'label' => esc_html__( 'Facebook settings', 'medical-insight' ), 'section' => 'medical_insight_urls', 'settings' => 'medical_insight_facebook_heading', ) ) ); $wp_customize->add_setting('medical_insight_facebook',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('medical_insight_facebook',array( 'label' => esc_html__('Add URL','medical-insight'), 'section' => 'medical_insight_urls', 'setting' => 'medical_insight_facebook', 'type' => 'url' )); $wp_customize->add_setting( 'medical_insight_header_fb_target', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'medical_care_callback_sanitize_switch', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Switch( $wp_customize, 'medical_insight_header_fb_target', array( 'settings' => 'medical_insight_header_fb_target', 'section' => 'medical_insight_urls', 'label' => __( 'Open link in a new tab', 'medical-insight' ), 'choices' => array( '1' => __( 'On', 'medical-insight' ), 'off' => __( 'Off', 'medical-insight' ), ), ) ) ); $wp_customize->add_setting( 'medical_insight_twitter_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Section_Heading( $wp_customize, 'medical_insight_twitter_heading', array( 'label' => esc_html__( 'Twitter settings', 'medical-insight' ), 'section' => 'medical_insight_urls', 'settings' => 'medical_insight_twitter_heading', ) ) ); $wp_customize->add_setting('medical_insight_twitter',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('medical_insight_twitter',array( 'label' => esc_html__('Add URL','medical-insight'), 'section' => 'medical_insight_urls', 'setting' => 'medical_insight_twitter', 'type' => 'url' )); $wp_customize->add_setting( 'medical_insight_header_twt_target', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'medical_care_callback_sanitize_switch', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Switch( $wp_customize, 'medical_insight_header_twt_target', array( 'settings' => 'medical_insight_header_twt_target', 'section' => 'medical_insight_urls', 'label' => __( 'Open link in a new tab', 'medical-insight' ), 'choices' => array( '1' => __( 'On', 'medical-insight' ), 'off' => __( 'Off', 'medical-insight' ), ), ) ) ); $wp_customize->add_setting( 'medical_insight_youtube_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Section_Heading( $wp_customize, 'medical_insight_youtube_heading', array( 'label' => esc_html__( 'Youtube settings', 'medical-insight' ), 'section' => 'medical_insight_urls', 'settings' => 'medical_insight_youtube_heading', ) ) ); $wp_customize->add_setting('medical_insight_youtube',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('medical_insight_youtube',array( 'label' => esc_html__('Add URL','medical-insight'), 'section' => 'medical_insight_urls', 'setting' => 'medical_insight_youtube', 'type' => 'url' )); $wp_customize->add_setting( 'medical_insight_header_ut_target', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'medical_care_callback_sanitize_switch', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Switch( $wp_customize, 'medical_insight_header_ut_target', array( 'settings' => 'medical_insight_header_ut_target', 'section' => 'medical_insight_urls', 'label' => __( 'Open link in a new tab', 'medical-insight' ), 'choices' => array( '1' => __( 'On', 'medical-insight' ), 'off' => __( 'Off', 'medical-insight' ), ), ) ) ); $wp_customize->add_setting( 'medical_insight_instagram_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Section_Heading( $wp_customize, 'medical_insight_instagram_heading', array( 'label' => esc_html__( 'Instagram settings', 'medical-insight' ), 'section' => 'medical_insight_urls', 'settings' => 'medical_insight_instagram_heading', ) ) ); $wp_customize->add_setting('medical_insight_instagram',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('medical_insight_instagram',array( 'label' => esc_html__('Add URL','medical-insight'), 'section' => 'medical_insight_urls', 'setting' => 'medical_insight_instagram', 'type' => 'url' )); $wp_customize->add_setting( 'medical_insight_header_ins_target', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'medical_care_callback_sanitize_switch', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Switch( $wp_customize, 'medical_insight_header_ins_target', array( 'settings' => 'medical_insight_header_ins_target', 'section' => 'medical_insight_urls', 'label' => __( 'Open link in a new tab', 'medical-insight' ), 'choices' => array( '1' => __( 'On', 'medical-insight' ), 'off' => __( 'Off', 'medical-insight' ), ), ) ) ); // Top bar Links $wp_customize->add_section('medical_insight_topbar_links',array( 'title' => __('Header Settings', 'medical-insight'), 'panel' => 'medical_care_custompage_panel', 'priority' => 2, ) ); $wp_customize->add_setting( 'medical_insight_top_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Section_Heading( $wp_customize, 'medical_insight_top_heading', array( 'label' => esc_html__( 'Header Settings', 'medical-insight' ), 'description' => __( 'Add menu links in the below feilds', 'medical-insight' ), 'section' => 'medical_insight_topbar_links', 'settings' => 'medical_insight_top_heading', ) ) ); $wp_customize->add_setting( 'medical_insight_top_bar_show_hide', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'medical_care_callback_sanitize_switch', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Switch( $wp_customize, 'medical_insight_top_bar_show_hide', array( 'settings' => 'medical_insight_top_bar_show_hide', 'section' => 'medical_insight_topbar_links', 'label' => __( 'Check to show top bar', 'medical-insight' ), 'choices' => array( '1' => __( 'On', 'medical-insight' ), 'off' => __( 'Off', 'medical-insight' ), ), 'active_callback' => '', ) ) ); $wp_customize->add_setting('medical_insight_text1',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('medical_insight_text1',array( 'label' => esc_html__('Text 1','medical-insight'), 'section' => 'medical_insight_topbar_links', 'setting' => 'medical_insight_text1', 'type' => 'text' )); $wp_customize->selective_refresh->add_partial( 'medical_insight_text1', array( 'selector' => '.topbar_links a', 'render_callback' => 'medical_care_customize_partial_medical_insight_text1', ) ); $wp_customize->add_setting('medical_insight_link1',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('medical_insight_link1',array( 'label' => esc_html__('URL 1','medical-insight'), 'section' => 'medical_insight_topbar_links', 'setting' => 'medical_insight_link1', 'type' => 'url' )); $wp_customize->add_setting('medical_insight_text2',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('medical_insight_text2',array( 'label' => esc_html__('Text 2','medical-insight'), 'section' => 'medical_insight_topbar_links', 'setting' => 'medical_insight_text2', 'type' => 'text' )); $wp_customize->add_setting('medical_insight_link2',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('medical_insight_link2',array( 'label' => esc_html__('URL 2','medical-insight'), 'section' => 'medical_insight_topbar_links', 'setting' => 'medical_insight_link2', 'type' => 'url' )); $wp_customize->add_setting('medical_insight_text3',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('medical_insight_text3',array( 'label' => esc_html__('Text 3','medical-insight'), 'section' => 'medical_insight_topbar_links', 'setting' => 'medical_insight_text3', 'type' => 'text' )); $wp_customize->add_setting('medical_insight_link3',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('medical_insight_link3',array( 'label' => esc_html__('URL 3','medical-insight'), 'section' => 'medical_insight_topbar_links', 'setting' => 'medical_insight_link3', 'type' => 'url' )); //slider $wp_customize->add_setting( 'medical_insight_slider_excerpt_show_hide', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'medical_care_callback_sanitize_switch', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Switch( $wp_customize, 'medical_insight_slider_excerpt_show_hide', array( 'settings' => 'medical_insight_slider_excerpt_show_hide', 'section' => 'medical_care_slider_section', 'label' => __( 'Show Hide excerpt', 'medical-insight' ), 'choices' => array( '1' => __( 'On', 'medical-insight' ), 'off' => __( 'Off', 'medical-insight' ), ), 'priority' => 3, 'active_callback' => 'medical_care_slider_dropdown', ) ) ); // About us $wp_customize->add_section( 'medical_insight_middle_section' , array( 'title' => __( 'About us Settings', 'medical-insight' ), 'panel' => 'medical_care_custompage_panel', 'priority' => 3, ) ); $wp_customize->add_setting( 'medical_insight_about_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Section_Heading( $wp_customize, 'medical_insight_about_heading', array( 'label' => esc_html__( 'About us Settings', 'medical-insight' ), 'section' => 'medical_insight_middle_section', 'settings' => 'medical_insight_about_heading', ) ) ); $wp_customize->add_setting( 'medical_insight_about_show_hide', array( 'type' => 'option', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'medical_care_callback_sanitize_switch', ) ); $wp_customize->add_control( new Medical_Insight_Customizer_Customcontrol_Switch( $wp_customize, 'medical_insight_about_show_hide', array( 'settings' => 'medical_insight_about_show_hide', 'section' => 'medical_insight_middle_section', 'label' => __( 'Check To show Section', 'medical-insight' ), 'choices' => array( '1' => __( 'On', 'medical-insight' ), 'off' => __( 'Off', 'medical-insight' ), ), 'active_callback' => '', ) ) ); $wp_customize->add_setting('medical_insight_about_title',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('medical_insight_about_title',array( 'label' => esc_html__('Title','medical-insight'), 'section' => 'medical_insight_middle_section', 'setting' => 'medical_insight_about_title', 'type' => 'text', 'active_callback' => 'medical_insight_about_dropdown', )); $wp_customize->selective_refresh->add_partial( 'medical_insight_about_title', array( 'selector' => '#middle-sec h6', 'render_callback' => 'medical_care_customize_partial_medical_insight_about_title', ) ); $wp_customize->add_setting('medical_insight_middle_sec_page_settigs',array( 'sanitize_callback' => 'medical_care_sanitize_dropdown_pages', )); $wp_customize->add_control('medical_insight_middle_sec_page_settigs',array( 'type' => 'dropdown-pages', 'label' => __('Select Page','medical-insight'), 'section' => 'medical_insight_middle_section', 'active_callback' => 'medical_insight_about_dropdown', )); $args = array('numberposts' => -1); $post_list = get_posts($args); $s = 0; $pst_sls[]= __('Select','medical-insight'); foreach ($post_list as $key => $p_post) { $pst_sls[$p_post->ID]=$p_post->post_title; } for ( $s = 1; $s <= 4; $s++ ) { $wp_customize->add_setting('medical_insight_mid_section_icon'.$s,array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('medical_insight_mid_section_icon'.$s,array( 'label' => esc_html__('Icon','medical-insight'), 'section' => 'medical_insight_middle_section', 'setting' => 'medical_insight_mid_section_icon', 'type' => 'text', 'active_callback' => 'medical_insight_about_dropdown', )); $wp_customize->add_setting('medical_insight_middle_sec_settigs'.$s,array( 'sanitize_callback' => 'medical_care_sanitize_choices', )); $wp_customize->add_control('medical_insight_middle_sec_settigs'.$s,array( 'type' => 'select', 'choices' => $pst_sls, 'label' => __('Select post','medical-insight'), 'section' => 'medical_insight_middle_section', 'active_callback' => 'medical_insight_about_dropdown', )); } wp_reset_postdata(); } add_action( 'customize_register', 'medical_insight_customize' ); function medical_insight_enqueue_comments_reply() { if( is_singular() && comments_open() && ( get_option( 'thread_comments' ) == 1) ) { // Load comment-reply.js (into footer) wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true ); } } add_action( 'wp_enqueue_scripts', 'medical_insight_enqueue_comments_reply' ); // Footer Text function medical_insight_copyright_link() { $footer_text = get_theme_mod('medical_care_footer_text', esc_html__('Medical WordPress Theme', 'medical-insight')); $credit_link = esc_url('https://www.ovationthemes.com/wordpress/free-medical-clinic-wordpress-theme/'); echo '' . esc_html($footer_text) . '' . esc_html__(' By Ovation Themes', 'medical-insight') . ''; }