Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2021
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.78 KB | None | 0 0
  1. function child_customizer( $wp_customize ){
  2.  
  3. $sections = array ( 'one', 'two', 'three', 'four', 'five', 'six' );
  4.  
  5. foreach( $sections as $section ){
  6. $wp_customize->add_setting(
  7. 'appointment_options[service_' . $section . '_url]',
  8. array(
  9. 'default' => '#',
  10. 'capability' => 'edit_theme_options',
  11. 'sanitize_callback' => 'appointment_service_sanitize_html',
  12. 'type' => 'option'
  13. )
  14. );
  15. $wp_customize->add_control(
  16. 'appointment_options[service_' . $section . '_url]',
  17. array(
  18. 'label' => esc_html__('URL', 'webriti-companion'),
  19. 'section' => 'service_section_' . $section,
  20. 'type' => 'text',
  21. )
  22. );
  23. }
  24.  
  25. }
  26. add_action( 'customize_register', 'child_customizer', 20 );
  27.  
  28. function appointment_services() {
  29. $theme = wp_get_theme();
  30. $appointment_options = appointment_theme_setup_data();
  31. $service_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_options);
  32.  
  33. if($theme->name =='Appointment Red'){
  34. $appointment_child_default_data=appointment_red_default_data();
  35. $service_child_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_child_default_data);
  36. }
  37. elseif($theme->name =='Shk Corporate'){
  38. $appointment_child_default_data=shk_corporate_default_data();
  39. $service_child_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_child_default_data);
  40. }
  41. elseif($theme->name =='Appointment Green'){
  42. $appointment_child_default_data=appointment_green_default_data();
  43. $service_child_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_child_default_data);
  44. }
  45. elseif($theme->name =='Appointment Blue'){
  46. $appointment_child_default_data=appointment_blue_default_data();
  47. $service_child_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_child_default_data);
  48. }
  49. //print_r($service_child_setting);
  50. if ($service_setting['service_section_enabled'] == 0) {
  51. if($theme->name == 'Appointment'){ $servicestyle='Service-section';}
  52. else if($theme->name =='Shk Corporate' && $service_child_setting['service_blink_layout_setting']=='blink' ){ $servicestyle='service-section1';}
  53. else if($theme->name =='Appointment Blue' && $service_child_setting['service_slide_layout_setting']=='slide'){ $servicestyle='service-section2';}
  54. else if($theme->name =='Appointment Red' && $service_child_setting['service_layout_setting']=='box' ){ $servicestyle='service-section3';}
  55. else if($theme->name =='Appointment Green' && $service_child_setting['service_rotate_layout_section']=='rotate'){ $servicestyle='Service-section service6';}
  56. else if($theme->name =='Appointment Dark'){ $servicestyle='service-section2';}
  57. else if($theme->name =='Appointee'){ $servicestyle='Service-section service7';}
  58. else{
  59. $servicestyle='Service-section';
  60. }
  61. ?>
  62. <div class="<?php echo $servicestyle; ?>">
  63. <div class="container">
  64.  
  65. <div class="row">
  66. <div class="col-md-12">
  67.  
  68. <div class="section-heading-title">
  69. <h1><?php echo wp_kses_post($service_setting['service_title']); ?></h1>
  70. <p><?php echo wp_kses_post($service_setting['service_description']); ?> </p>
  71. </div>
  72. </div>
  73. </div>
  74.  
  75. <div class="row">
  76. <?php
  77. $sections = array ( 'one', 'two', 'three', 'four', 'five', 'six' );
  78. foreach( $sections as $section ) :
  79. $section_url = @wp_kses_post($service_setting['service_' . $section . '_url']);
  80.  
  81. ?>
  82. <?php if($service_setting['service_' . $section . '_icon'] || $service_setting['service_' . $section . '_title'] || $service_setting['service_' . $section . '_description']){ ?>
  83. <div class="col-md-4">
  84. <div class="service-area">
  85. <div class="media">
  86. <a href="<?php echo $section_url; ?>" class="service_url"></a>
  87. <?php if($service_setting['service_' . $section . '_icon']):?>
  88. <div class="service-icon">
  89. <i class="fa <?php echo esc_attr($service_setting['service_' . $section . '_icon']); ?>"></i>
  90. </div>
  91. <?php endif;
  92. if($service_setting['service_' . $section . '_title'] || $service_setting['service_' . $section . '_description']):?>
  93. <div class="media-body">
  94. <h3><?php echo wp_kses_post($service_setting['service_' . $section . '_title']); ?></h3>
  95. <p><?php echo wp_kses_post($service_setting['service_' . $section . '_description']); ?></p>
  96. </div>
  97. <?php endif;?>
  98. </div>
  99. </div>
  100. </div>
  101. <?php }
  102. endforeach;
  103. ?>
  104.  
  105. <div class="clearfix"></div>
  106. </div>
  107. </div>
  108. </div>
  109. <!-- /HomePage Service Section -->
  110. <?php
  111. }
  112. }
  113.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement