Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function child_customizer( $wp_customize ){
- $sections = array ( 'one', 'two', 'three', 'four', 'five', 'six' );
- foreach( $sections as $section ){
- $wp_customize->add_setting(
- 'appointment_options[service_' . $section . '_url]',
- array(
- 'default' => '#',
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'appointment_service_sanitize_html',
- 'type' => 'option'
- )
- );
- $wp_customize->add_control(
- 'appointment_options[service_' . $section . '_url]',
- array(
- 'label' => esc_html__('URL', 'webriti-companion'),
- 'section' => 'service_section_' . $section,
- 'type' => 'text',
- )
- );
- }
- }
- add_action( 'customize_register', 'child_customizer', 20 );
- function appointment_services() {
- $theme = wp_get_theme();
- $appointment_options = appointment_theme_setup_data();
- $service_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_options);
- if($theme->name =='Appointment Red'){
- $appointment_child_default_data=appointment_red_default_data();
- $service_child_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_child_default_data);
- }
- elseif($theme->name =='Shk Corporate'){
- $appointment_child_default_data=shk_corporate_default_data();
- $service_child_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_child_default_data);
- }
- elseif($theme->name =='Appointment Green'){
- $appointment_child_default_data=appointment_green_default_data();
- $service_child_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_child_default_data);
- }
- elseif($theme->name =='Appointment Blue'){
- $appointment_child_default_data=appointment_blue_default_data();
- $service_child_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_child_default_data);
- }
- //print_r($service_child_setting);
- if ($service_setting['service_section_enabled'] == 0) {
- if($theme->name == 'Appointment'){ $servicestyle='Service-section';}
- else if($theme->name =='Shk Corporate' && $service_child_setting['service_blink_layout_setting']=='blink' ){ $servicestyle='service-section1';}
- else if($theme->name =='Appointment Blue' && $service_child_setting['service_slide_layout_setting']=='slide'){ $servicestyle='service-section2';}
- else if($theme->name =='Appointment Red' && $service_child_setting['service_layout_setting']=='box' ){ $servicestyle='service-section3';}
- else if($theme->name =='Appointment Green' && $service_child_setting['service_rotate_layout_section']=='rotate'){ $servicestyle='Service-section service6';}
- else if($theme->name =='Appointment Dark'){ $servicestyle='service-section2';}
- else if($theme->name =='Appointee'){ $servicestyle='Service-section service7';}
- else{
- $servicestyle='Service-section';
- }
- ?>
- <div class="<?php echo $servicestyle; ?>">
- <div class="container">
- <div class="row">
- <div class="col-md-12">
- <div class="section-heading-title">
- <h1><?php echo wp_kses_post($service_setting['service_title']); ?></h1>
- <p><?php echo wp_kses_post($service_setting['service_description']); ?> </p>
- </div>
- </div>
- </div>
- <div class="row">
- <?php
- $sections = array ( 'one', 'two', 'three', 'four', 'five', 'six' );
- foreach( $sections as $section ) :
- $section_url = @wp_kses_post($service_setting['service_' . $section . '_url']);
- ?>
- <?php if($service_setting['service_' . $section . '_icon'] || $service_setting['service_' . $section . '_title'] || $service_setting['service_' . $section . '_description']){ ?>
- <div class="col-md-4">
- <div class="service-area">
- <div class="media">
- <a href="<?php echo $section_url; ?>" class="service_url"></a>
- <?php if($service_setting['service_' . $section . '_icon']):?>
- <div class="service-icon">
- <i class="fa <?php echo esc_attr($service_setting['service_' . $section . '_icon']); ?>"></i>
- </div>
- <?php endif;
- if($service_setting['service_' . $section . '_title'] || $service_setting['service_' . $section . '_description']):?>
- <div class="media-body">
- <h3><?php echo wp_kses_post($service_setting['service_' . $section . '_title']); ?></h3>
- <p><?php echo wp_kses_post($service_setting['service_' . $section . '_description']); ?></p>
- </div>
- <?php endif;?>
- </div>
- </div>
- </div>
- <?php }
- endforeach;
- ?>
- <div class="clearfix"></div>
- </div>
- </div>
- </div>
- <!-- /HomePage Service Section -->
- <?php
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement