Advertisement
123KArolina123

Untitled

Nov 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.03 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying header
  4. * @package LMS
  5. * @copyright Copyright (c) 2014, Chimp Studio
  6. */
  7.  
  8. global $options,$cs_theme_options, $cs_position, $cs_page_builder, $cs_meta_page, $cs_node, $cs_xmlObject,$options,$page_option,$post,$page_colors;
  9. $slider_position = '';
  10. $header_style = '';
  11. $global_var_set = 0 ;
  12. if(is_page()){
  13. $cs_page_bulider = get_post_meta($post->ID, "cs_page_builder", true);
  14. $cs_xmlData = new stdClass();
  15. if(isset($cs_page_bulider) && $cs_page_bulider <> ''){
  16. $cs_xmlData = new SimpleXMLElement($cs_page_bulider);
  17. $slider_position = (!empty($cs_xmlData->slider_position))? $cs_xmlData->slider_position : '' ;
  18. $header_style = (!empty($cs_xmlData->header_banner_style))? $cs_xmlData->header_banner_style : '' ;
  19. }
  20. $cs_page_options = (!empty($cs_xmlData->cs_page_options))? $cs_xmlData->cs_page_options : '' ;
  21. if(isset($cs_page_options) and $cs_page_options != 'default' and $cs_page_options <> ''){
  22. $cs_page_options = trim($cs_page_options);
  23. $settings =$page_option['theme_options'][$cs_page_options]['theme_option'];
  24. $page_setting=unserialize(base64_decode($settings));
  25. $cs_theme_options = $page_setting;
  26. $global_var_set = 1 ;
  27.  
  28. }
  29. }
  30. // assign un assigned variables with empty string again
  31. include (get_template_directory() . '/include/theme-components/theme_gobal.php');
  32. /* theme unit testing code start*/
  33. if(!($cs_theme_options)){
  34. $activation_data = cs_reset_data();
  35. $cs_theme_options = $activation_data;
  36. $cs_theme_options['cs_default_layout_sidebar'] = 'sidebar-1';
  37. $cs_theme_options['cs_footer_widget'] = 'off';
  38. }
  39. /* theme unit testing code end */
  40. $cs_builtin_seo_fields =$cs_theme_options['cs_builtin_seo_fields'];
  41.  
  42. if(isset($cs_theme_options['cs_layout'])){ $cs_site_layout =$cs_theme_options['cs_layout'];} else { $cs_site_layout == '';}
  43. ?>
  44. <!DOCTYPE html>
  45. <html <?php language_attributes(); ?>>
  46. <head>
  47. <meta charset="<?php bloginfo( 'charset' ); ?>">
  48.  
  49. <?php cs_page_metakey(); ?>
  50.  
  51.  
  52. <link rel="profile" href="http://gmpg.org/xfn/11">
  53. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
  54. <?php
  55. if(isset($cs_theme_options['cs_custom_css']) and $cs_theme_options['cs_custom_css']<>''){
  56. echo '<style type="text/css" scoped>
  57. '. $cs_theme_options['cs_custom_css'].'
  58. </style> ';
  59. }
  60. if(isset($cs_theme_options['cs_custom_js']) and $cs_theme_options['cs_custom_js']<>''){
  61. echo '<script type="text/javascript">
  62. '. $cs_theme_options['cs_custom_js'].'
  63. </script> ';
  64. }
  65. if ( function_exists( 'cs_header_settings' ) ) { cs_header_settings(); }
  66. if ( is_singular() && get_option( 'thread_comments' ) )
  67. wp_enqueue_script( 'comment-reply' );
  68. //if(isset($cs_theme_options['cs_style_rtl']) and $cs_theme_options['cs_style_rtl']=='on'){
  69. //cs_rtl();
  70. //}
  71. //=====================================================================
  72. // Header Colors
  73. //=====================================================================
  74. if ( function_exists( 'cs_header_color' ) ) { cs_header_color(); }
  75.  
  76. //=====================================================================
  77. // Theme Colors
  78. //=====================================================================
  79. if ( function_exists( 'cs_footer_color' ) ) { cs_footer_color(); }
  80. if ( function_exists( 'cs_theme_colors' ) ) { cs_theme_colors(); }
  81. wp_head();
  82. ?>
  83. </head>
  84.  
  85. <body <?php body_class('rtl'); if($cs_site_layout !='full_width'){ if ( function_exists( 'cs_bg_image' ) ) { echo cs_bg_image(); } } ?>>
  86. <?php if ( function_exists( 'cs_under_construction' ) ) { cs_under_construction(); } ?>
  87. <!-- Wrapper Start -->
  88. <div class="wrapper <?php if ( function_exists( 'cs_header_postion_class' ) ) { echo cs_header_postion_class(); } ?> wrapper_<?php if ( function_exists( 'cs_wrapper_class' ) ) { cs_wrapper_class(); }?>">
  89. <!-- Header Start -->
  90. <?php
  91. if($header_style == 'custom_slider' && $slider_position == 'above'){
  92. if(isset($_REQUEST['course_id']) && $_REQUEST['course_id'] !=''){
  93. if ( function_exists( 'cs_subheader_style' ) ) { cs_subheader_style($_REQUEST['course_id']); }
  94. } else {
  95. if ( function_exists( 'cs_subheader_style' ) ) { cs_subheader_style(); }
  96. }
  97. if ( function_exists( 'cs_get_headers' ) ) { cs_get_headers(); }
  98. if(isset($cs_theme_options['cs_smooth_scroll']) and $cs_theme_options['cs_smooth_scroll'] == 'on'){
  99. ?>
  100. <script type="text/javascript">
  101. jQuery(document).ready(function($){
  102. cs_nicescroll();
  103. });
  104. </script>
  105. <?php
  106. }
  107.  
  108. if (isset($cs_theme_options['cs_sitcky_header_switch']) and $cs_theme_options['cs_sitcky_header_switch'] == "on"){
  109. cs_scrolltofix();
  110. ?>
  111. <script type="text/javascript">
  112. jQuery(document).ready(function(){
  113. jQuery('.main-head').scrollToFixed();
  114. });
  115. </script>
  116. <?php }?>
  117. <div class="clear"></div>
  118. <?php
  119. }else{
  120. if ( function_exists( 'cs_get_headers' ) ) { cs_get_headers(); }
  121. if(isset($cs_theme_options['cs_smooth_scroll']) and $cs_theme_options['cs_smooth_scroll'] == 'on'){
  122. ?>
  123. <script type="text/javascript">
  124. jQuery(document).ready(function($){
  125. cs_nicescroll();
  126. });
  127. </script>
  128. <?php
  129. }
  130. if (isset($cs_theme_options['cs_sitcky_header_switch']) and $cs_theme_options['cs_sitcky_header_switch'] == "on"){
  131. cs_scrolltofix();
  132. ?>
  133. <script type="text/javascript">
  134. jQuery(document).ready(function(){
  135. jQuery('.main-head').scrollToFixed();
  136. });
  137. </script>
  138. <?php
  139. }
  140. ?>
  141. <div class="clear"></div>
  142. <?php
  143. cs_header_position_settings();
  144. ?>
  145. <!-- Breadcrumb SecTion -->
  146. <?php
  147. if(isset($_REQUEST['course_id']) && $_REQUEST['course_id'] !=''){
  148. if ( function_exists( 'cs_subheader_style' ) ) { cs_subheader_style($_REQUEST['course_id']); }
  149. } else {
  150. if ( function_exists( 'cs_subheader_style' ) ) { cs_subheader_style(); }
  151. }
  152. }
  153. ?>
  154. <!-- Breadcrumb SecTion -->
  155. <!-- Main Content Section -->
  156. <main id="main-content">
  157. <?php
  158. if(is_single() && $post_type == 'courses'){
  159. if ( empty($cs_xmlObject->dynamic_post_course_view) ) $dynamic_post_course_view = ""; else $dynamic_post_course_view = $cs_xmlObject->dynamic_post_course_view;
  160. if ( empty($cs_xmlObject->course_subheader_bg_color) ) $course_subheader_bg_color = ""; else $course_subheader_bg_color = $cs_xmlObject->course_subheader_bg_color;
  161.  
  162. $bgcolor_style = '';
  163. if($course_subheader_bg_color <> ''){
  164. $bgcolor_style = 'background-color: '.$course_subheader_bg_color.';';
  165. }
  166. if($dynamic_post_course_view == 'Wide'){
  167. $width = 200;
  168. $height = 150;
  169. $image_url = cs_get_post_img_src($post->ID, $width, $height);
  170. if($cs_xmlObject->course_short_description <> '' || $cs_xmlObject->course_tags_show == 'on' || $image_url <> ''){
  171.  
  172. if ( function_exists( 'cs_course_shortdescription_area' ) ) {
  173.  
  174. ?>
  175. <section class="page-section <?php echo esc_attr($dynamic_post_course_view);?>" style=" padding: 0; <?php echo esc_attr($bgcolor_style);?> ">
  176. <!-- Container -->
  177. <div class="container">
  178. <!-- Row -->
  179. <div class="row">
  180. <!-- Col Start -->
  181. <div class="col-md-12">
  182. <!-- Row -->
  183. <div class="row">
  184. <div class="col-md-12">
  185. <?php if ( function_exists( 'cs_course_shortdescription_area' ) ) { cs_course_shortdescription_area(); } ?>
  186. </div>
  187. <!-- Col Start -->
  188. </div>
  189. <!-- Row -->
  190. </div>
  191. <!-- Col End -->
  192. </div>
  193. <!-- Row -->
  194. </div>
  195. <!-- Container -->
  196. </section>
  197.  
  198. <?php
  199. }
  200. }
  201.  
  202. }
  203. }
  204. ?>
  205. <!-- Main Section Start -->
  206. <div class="main-section">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement