80, 'width' => 100, )); add_theme_support('automatic-feed-links'); register_nav_menus(array( 'primary' => __('Primary Menu', 'bizhub'), )); } add_action('after_setup_theme', 'bizhub_setup'); function bizhub_add_editor_styles() { add_editor_style('editor-style.css'); } add_action('after_setup_theme', 'bizhub_add_editor_styles'); function bizhub_enqueue_comment_reply_script() { if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } add_action('wp_enqueue_scripts', 'bizhub_enqueue_comment_reply_script'); function bizhub_enqueue_customizer_scripts() { wp_enqueue_script('bizhub-customizer-js', get_template_directory_uri() . '/assets/js/customizer.js', ['jquery', 'wp-mediaelement'], '', true); } add_action('customize_controls_enqueue_scripts', 'bizhub_enqueue_customizer_scripts'); function bizhub_enqueue_scripts(): void { wp_enqueue_style('bizhub-style', get_stylesheet_uri()); wp_enqueue_style('bizhub-custom-style', get_template_directory_uri() . '/assets/css/bizhub-style.css'); wp_enqueue_style('bizhub-font-awesome', get_template_directory_uri(). '/assets/icons/css/all.min.css', array(), '6.5.1', 'all'); wp_enqueue_script('bizhub-custom-js', get_template_directory_uri() . '/assets/js/script.js', array('jquery'), false, true); } add_action('wp_enqueue_scripts', 'bizhub_enqueue_scripts'); function bizhub_add_li_class($classes, $item, $args, $depth) { if ($args->theme_location == 'primary') { $classes[] = 'bizhub-nav-link'; } return $classes; } add_filter('nav_menu_css_class', 'bizhub_add_li_class', 10, 4); function bizhub_customize_register($wp_customize) { require_once get_template_directory() . '/inc/customizer-repeater.php'; $wp_customize->add_panel('frontpage_panel', array( 'title' => __('Theme Sections Settings', 'bizhub'), 'priority' => 30, 'active_callback' => 'bizhub_is_customizing_front_page', )); // Hero Section Panel $wp_customize->add_section('bizhub_hero_section', array( 'title' => __('Hero Section', 'bizhub'), 'priority' => 30, 'panel' => 'frontpage_panel', )); // Menu CTA Button $wp_customize->add_setting('bizhub_menu_cta_button_text', array( 'default' => 'Get Started', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_menu_cta_button_text_control', array( 'label' => __('Menu CTA Button Text', 'bizhub'), 'section' => 'bizhub_hero_section', 'settings' => 'bizhub_menu_cta_button_text', 'type' => 'text', )); // Menu CTA Button URL $wp_customize->add_setting('bizhub_menu_cta_button_url', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('bizhub_menu_cta_button_url_control', array( 'label' => __('Menu CTA Button Link', 'bizhub'), 'section' => 'bizhub_hero_section', 'settings' => 'bizhub_menu_cta_button_url', 'type' => 'url', )); // Background Image $wp_customize->add_setting('bizhub_hero_bg_image', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'bizhub_hero_bg_image_control', array( 'label' => __('Background Image', 'bizhub'), 'section' => 'bizhub_hero_section', 'settings' => 'bizhub_hero_bg_image', ))); // Hero Title $wp_customize->add_setting('bizhub_hero_title', array( 'default' => 'Welcome to My Site', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_hero_title_control', array( 'label' => __('Hero Title', 'bizhub'), 'section' => 'bizhub_hero_section', 'settings' => 'bizhub_hero_title', 'type' => 'text', )); // Hero Subtext $wp_customize->add_setting('bizhub_hero_subtext', array( 'default' => 'This is my hero subtext.', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_hero_subtext_control', array( 'label' => __('Hero Subtext', 'bizhub'), 'section' => 'bizhub_hero_section', 'settings' => 'bizhub_hero_subtext', 'type' => 'textarea', )); // Button 1 Text $wp_customize->add_setting('bizhub_hero_button1_text', array( 'default' => 'Get Started', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_hero_button1_text_control', array( 'label' => __('Button 1 Text', 'bizhub'), 'section' => 'bizhub_hero_section', 'settings' => 'bizhub_hero_button1_text', 'type' => 'text', )); // Button 1 URL $wp_customize->add_setting('bizhub_hero_button1_url', array( 'default' => '#', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('bizhub_hero_button1_url_control', array( 'label' => __('Button 1 URL', 'bizhub'), 'section' => 'bizhub_hero_section', 'settings' => 'bizhub_hero_button1_url', 'type' => 'url', )); // Button 2 Text $wp_customize->add_setting('bizhub_hero_button2_text', array( 'default' => 'Learn More', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_hero_button2_text_control', array( 'label' => __('Button 2 Text', 'bizhub'), 'section' => 'bizhub_hero_section', 'settings' => 'bizhub_hero_button2_text', 'type' => 'text', )); // Button 2 URL $wp_customize->add_setting('bizhub_hero_button2_url', array( 'default' => '#', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('bizhub_hero_button2_url_control', array( 'label' => __('Button 2 URL', 'bizhub'), 'section' => 'bizhub_hero_section', 'settings' => 'bizhub_hero_button2_url', 'type' => 'url', )); // About Us Section $wp_customize->add_section('bizhub_about_us_section', array( 'title' => __('About Us Section', 'bizhub'), 'priority' => 34, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_about_us_title', array( 'default'=> 'About Us', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_about_us_title_control', array( 'label' => __('About Us Title', 'bizhub'), 'section' => 'bizhub_about_us_section', 'settings' => 'bizhub_about_us_title', 'type' => 'text', )); $wp_customize->add_setting('bizhub_about_us_subtext', array( 'default' => 'This is about us subtext', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_about_us_subtext_control', array( 'label' => __('About Us SubText', 'bizhub'), 'section' => 'bizhub_about_us_section', 'settings' =>'bizhub_about_us_subtext', 'type' => 'textarea', )); $wp_customize->add_setting('bizhub_about_us_text', array( 'default' => 'This is about us text', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_about_us_text_control', array( 'label' => __('About Us Text', 'bizhub'), 'section' => 'bizhub_about_us_section', 'settings' =>'bizhub_about_us_text', 'type' => 'textarea', )); $wp_customize->add_setting('bizhub_about_us_url_text', array( 'default'=>'Read More', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_about_us_url_text_control', array( 'label'=>__('About Us url Text', 'bizhub'), 'section'=>'bizhub_about_us_section', 'settings'=>'bizhub_about_us_url_text', 'type'=>'text', )); $wp_customize->add_setting('bizhub_about_us_url', array( 'default'=>'#', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('bizhub_about_us_url_control', array( 'label'=>__('About Us Url', 'bizhub'), 'section'=>'bizhub_about_us_section', 'settings'=>'bizhub_about_us_url', 'type'=>'url', )); $wp_customize->add_setting('bizhub_about_us_image',array( 'default'=>'', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'bizhub_about_us_image_control', array( 'label' => __('About Us Image', 'bizhub'), 'section' => 'bizhub_about_us_section', 'settings' => 'bizhub_about_us_image', ))); // Middle Section $wp_customize->add_section('bizhub_middle_section', array( 'title' => __('Middle Section', 'bizhub'), 'priority'=>38, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_middle_repeater', array( 'default' => json_encode([]), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bizhub_Customizer_Repeater($wp_customize, 'bizhub_middle_repeater', array( 'label' => __('Middle Section', 'bizhub'), 'section' => 'bizhub_middle_section', 'fields' => array( array('id' => 'title', 'type' => 'text', 'label' => 'Middle Section Title'), array('id' => 'middle_subtext', 'type' => 'text', 'label' => 'Section Text 1'), array('id' => 'middle_text', 'type' => 'text', 'label' => 'Section Text 2'), array('id' => 'image', 'type' => 'image', 'label' => 'Section Image'), array('id' => 'link_text', 'type' => 'text', 'label' => 'Link Text'), array('id' => 'middle_section_link', 'type' => 'url', 'label' => 'Section Link'), ), ))); // Contact Section $wp_customize->add_section('bizhub_contact_section', array( 'title' => __('Contact Section', 'bizhub'), 'priority' => 50, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_contact_title', array( 'default'=> 'Contact Us', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_contact_title_control', array( 'label' => __('Contact Title', 'bizhub'), 'section' => 'bizhub_contact_section', 'settings' => 'bizhub_contact_title', 'type' => 'text', )); $wp_customize->add_setting('bizhub_contact_subtext', array( 'default' => 'Say Something about your contact', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_contact_subtext_control', array( 'label' => __('Contact SubText', 'bizhub'), 'section' => 'bizhub_contact_section', 'settings' =>'bizhub_contact_subtext', 'type' => 'textarea', )); $wp_customize->add_setting('bizhub_contact_email', array( 'default' => 'mail@yourdomain.com', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_email', )); $wp_customize->add_control('bizhub_contact_email_control', array( 'label' => __('Contact Email', 'bizhub'), 'section' => 'bizhub_contact_section', 'settings' =>'bizhub_contact_email', 'type' => 'text', )); $wp_customize->add_setting('bizhub_contact_number', array( 'default' => '+123 456 7890', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_contact_number_control', array( 'label' => __('Contact Number(s)', 'bizhub'), 'section' => 'bizhub_contact_section', 'settings' =>'bizhub_contact_number', 'type' => 'tel', )); $wp_customize->add_setting('bizhub_contact_address', array( 'default' => '123 Main Street, City', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_contact_address_control', array( 'label' => __('Contact Address', 'bizhub'), 'section' => 'bizhub_contact_section', 'settings' =>'bizhub_contact_address', 'type' => 'textarea', )); $wp_customize->add_setting('bizhub_linkedin_url', array( 'default'=>'', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('bizhub_linkedin_url_control', array( 'label'=>__('Linkedin Link', 'bizhub'), 'section'=>'bizhub_contact_section', 'settings'=>'bizhub_linkedin_url', 'type'=>'url', )); $wp_customize->add_setting('bizhub_facebook_url', array( 'default'=>'', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('bizhub_facebook_url_control', array( 'label'=>__('Facebook Link', 'bizhub'), 'section'=>'bizhub_contact_section', 'settings'=>'bizhub_facebook_url', 'type'=>'url', )); $wp_customize->add_setting('bizhub_twitter_url', array( 'default'=>'', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('bizhub_twitter_url_control', array( 'label'=>__('Twitter / X Link', 'bizhub'), 'section'=>'bizhub_contact_section', 'settings'=>'bizhub_twitter_url', 'type'=>'url', )); $wp_customize->add_setting('bizhub_map_url', array( 'default'=>'', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('bizhub_map_url_control', array( 'label'=>__('Paste your Map link', 'bizhub'), 'section'=>'bizhub_contact_section', 'settings'=>'bizhub_map_url', 'type'=>'textarea', )); $wp_customize->add_setting('bizhub_contact_bg_image',array( 'default'=>'', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'bizhub_contact_bg_image_control', array( 'label' => __('Contact Background Image', 'bizhub'), 'section' => 'bizhub_contact_section', 'settings' => 'bizhub_contact_bg_image', ))); // Team Section $wp_customize->add_section('bizhub_team_section', array( 'title' => __('Team Section', 'bizhub'), 'priority' => 42, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_team_title', array( 'default'=>'team', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_team_title_control', array( 'label'=>__('Title', 'bizhub'), 'section'=>'bizhub_team_section', 'settings'=>'bizhub_team_title' )); $wp_customize->add_setting('bizhub_team_title_para', array( 'default'=>'', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_team_title_para_control', array( 'label'=>__('Title Text', 'bizhub'), 'section'=>'bizhub_team_section', 'settings'=>'bizhub_team_title_para', )); $wp_customize->add_setting('bizhub_team_repeater', array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bizhub_Customizer_Repeater($wp_customize, 'bizhub_team_repeater', array( 'label' => __('Team', 'bizhub'), 'section' => 'bizhub_team_section', 'fields' => array( array('id' => 'name', 'type' => 'text', 'label' => 'Team Member Name'), array('id' => 'role', 'type' => 'text', 'label' => 'Role'), array('id' => 'image', 'type' => 'image', 'label' => 'Profile Picture'), array('id' => 'linkedin', 'type' => 'url', 'label' => 'LinkedIn Profile'), array('id' => 'facebook', 'type' => 'url', 'label' => 'Facebook Profile'), array('id' => 'twitter', 'type' => 'url', 'label' => 'Twitter Profile'), ), ))); // Services Section $wp_customize->add_section('bizhub_services_section', array( 'title' => __('Services Section', 'bizhub'), 'priority' => 40, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_service_title', array( 'default'=>'service', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_service_title_control', array( 'label'=>__('Title', 'bizhub'), 'section'=>'bizhub_services_section', 'settings'=>'bizhub_service_title' )); $wp_customize->add_setting('bizhub_service_title_para', array( 'default'=>'', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_service_title_para_control', array( 'label'=>__('Title Text', 'bizhub'), 'section'=>'bizhub_services_section', 'settings'=>'bizhub_service_title_para', )); $wp_customize->add_setting('bizhub_service_repeater', array( 'default' => json_encode([]), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bizhub_Customizer_Repeater($wp_customize, 'bizhub_service_repeater', array( 'label' => __('Services', 'bizhub'), 'section' => 'bizhub_services_section', 'fields' => array( array('id' => 'title', 'type' => 'text', 'label' => 'Service Title'), array('id' => 'description', 'type' => 'textarea', 'label' => 'Description'), array('id' => 'image', 'type' => 'image', 'label' => 'Service Image'), ), ))); // Portfolio Section $wp_customize->add_section('bizhub_portfolio_section', array( 'title' => __('Portfolio Section', 'bizhub'), 'priority' => 46, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_portfolio_title', array( 'default'=>'portfolio', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_portfolio_title_control', array( 'label'=>__('Title', 'bizhub'), 'section'=>'bizhub_portfolio_section', 'settings'=>'bizhub_portfolio_title' )); $wp_customize->add_setting('bizhub_portfolio_title_para', array( 'default'=>'', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_portfolio_title_para_control', array( 'label'=>__('Title Text', 'bizhub'), 'section'=>'bizhub_portfolio_section', 'settings'=>'bizhub_portfolio_title_para', )); $wp_customize->add_setting('bizhub_portfolio_repeater', array( 'default' => json_encode([]), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bizhub_Customizer_Repeater($wp_customize, 'bizhub_portfolio_repeater', array( 'label' => __('Portfolio', 'bizhub'), 'section' => 'bizhub_portfolio_section', 'fields' => array( array('id' => 'image', 'type' => 'image', 'label' => 'Project Image'), array('id' => 'project_name', 'type' => 'text', 'label' => 'Project Name'), array('id' => 'project_link', 'type' => 'url', 'label' => 'Project Link'), ), ))); // Testimonial Section $wp_customize->add_section('bizhub_testimonial_section', array( 'title' => __('Testimonial Section', 'bizhub'), 'priority' => 48, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_testimonial_title', array( 'default'=>'Testimonial', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_testimonial_title_control', array( 'label'=>__('Title', 'bizhub'), 'section'=>'bizhub_testimonial_section', 'settings'=>'bizhub_testimonial_title' )); $wp_customize->add_setting('bizhub_testimonial_title_para', array( 'default'=>'Say something', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_testimonial_title_para_control', array( 'label'=>__('Title Text', 'bizhub'), 'section'=>'bizhub_testimonial_section', 'settings'=>'bizhub_testimonial_title_para', )); $wp_customize->add_setting('bizhub_testimonial_repeater', array( 'default' => json_encode([]), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bizhub_Customizer_Repeater($wp_customize, 'bizhub_testimonial_repeater', array( 'label' => __('Testimonial', 'bizhub'), 'section' => 'bizhub_testimonial_section', 'fields' => array( array('id' => 'name', 'type' => 'text', 'label' => 'Testimonial Giver Name'), array('id' => 'description', 'type' => 'textarea', 'label' => 'Testimonial Description'), array('id' => 'image', 'type' => 'image', 'label' => 'Testimonial Giver Image'), array('id' => 'linkedin', 'type' => 'url', 'label' => 'LinkedIn Profile'), ), ))); // Features Section $wp_customize->add_section('bizhub_features_section', array( 'title' => __('Feature Section', 'bizhub'), 'priority' => 32, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_feature_repeater', array( 'default' => json_encode([]), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bizhub_Customizer_Repeater($wp_customize, 'bizhub_feature_repeater', array( 'label' => __('feature', 'bizhub'), 'section' => 'bizhub_features_section', 'fields' => array( array('id' => 'feature_name', 'type' => 'text', 'label' => 'feature Name'), array('id' => 'description', 'type' => 'textarea', 'label' => 'feature Description'), array('id' => 'image', 'type' => 'image', 'label' => 'feature Image'), ), ))); // Expertise Section $wp_customize->add_section('bizhub_expertise_section', array( 'title' => __('Expertise Section', 'bizhub'), 'priority' => 36, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_expertise_title', array( 'default'=>'expertise', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_expertise_title_control', array( 'label'=>__('Title', 'bizhub'), 'section'=>'bizhub_expertise_section', 'settings'=>'bizhub_expertise_title' )); $wp_customize->add_setting('bizhub_expertise_title_para', array( 'default'=>'Brag about your expertise', 'transport'=>'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bizhub_expertise_title_para_control', array( 'label'=>__('Title Text', 'bizhub'), 'section'=>'bizhub_expertise_section', 'settings'=>'bizhub_expertise_title_para', )); $wp_customize->add_setting('bizhub_expertise_repeater', array( 'default' => json_encode([]), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bizhub_Customizer_Repeater($wp_customize, 'bizhub_expertise_repeater', array( 'label' => __('Expertise', 'bizhub'), 'section' => 'bizhub_expertise_section', 'fields' => array( array('id' => 'expertise_name', 'type' => 'text', 'label' => 'Expertise Name'), array('id' => 'description', 'type' => 'textarea', 'label' => 'Expertise Description'), array('id' => 'image', 'type' => 'image', 'label' => 'Expertise Image'), array('id' => 'expertise_link_text', 'type' => 'text', 'label' => 'Expertise Name'), array('id' => 'expertise_link', 'type' => 'url', 'label' => 'Expertise Link'), ), ))); // CTA Section $wp_customize->add_section('bizhub_cta_section', array( 'title' => __('CTA Section', 'bizhub'), 'priority' => 44, 'panel' => 'frontpage_panel', )); $wp_customize->add_setting('bizhub_cta_repeater', array( 'default' => json_encode([]), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bizhub_Customizer_Repeater($wp_customize, 'bizhub_cta_repeater', array( 'label' => __('CTA', 'bizhub'), 'section' => 'bizhub_cta_section', 'fields' => array( array('id' => 'text', 'type' => 'text', 'label' => 'Main Text'), array('id' => 'description', 'type' => 'textarea', 'label' => 'CTA Description'), array('id' => 'cta_button_text', 'type' => 'text', 'label' => 'CTA Button Text'), array('id' => 'cta_link', 'type' => 'url', 'label' => 'CTA Button Link'), ), ))); } add_action('customize_register', 'bizhub_customize_register'); function bizhub_is_customizing_front_page() { // This makes it work properly in the Customizer preview return is_front_page() && is_customize_preview(); } function bizhub_customizer_inline_css() { ?>