Advertisement
asif90

Code Validation

Dec 14th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.96 KB | None | 0 0
  1. /*=============== Footer.php ================*/
  2. <?php
  3.  
  4. $stock_body_end_script = cs_get_option('stock_body_end_script');
  5. $stock_copyright_text = cs_get_option('stock_copyright_text');
  6.  
  7. $stock_copyright_text_allow =array(
  8. 'a' => array(
  9. 'href' => array(),
  10. 'title' => array()
  11. ),
  12. 'img' => array(
  13. 'alt' => array(),
  14. 'src' => array()
  15. ),
  16. 'br' => array(),
  17. 'em' => array(),
  18. 'strong' => array(),
  19. );
  20. ?>
  21.  
  22. <footer id="colophon" class="site-footer" role="contentinfo">
  23. <div class="widget-footer-border">
  24. <div class="container">
  25. <div class="footer-widget">
  26. <div class="row">
  27. <?php
  28. if(is_active_sidebar('stock_footer')) {(dynamic_sidebar('stock_footer'));}
  29. ?>
  30. </div><!-- .site-info -->
  31. </div><!-- .site-info -->
  32. </div>
  33. </div>
  34.  
  35. <div class="container">
  36. <div class="col-md-12 text-center">
  37. <div class="copyright-text">
  38. <?php if(!empty($stock_copyright_text)){ echo wp_kses($stock_copyright_text, $stock_copyright_text_allow); } else {esc_html_e('copyritht &copy All right are reserve', 'stock-crazycafe');} ?>
  39. </div>
  40. </div>
  41. </div>
  42.  
  43. </footer><!-- #colophon -->
  44. </div><!-- #page -->
  45.  
  46. <?php echo $stock_body_end_script; wp_footer(); ?>
  47.  
  48. </body>
  49. </html>
  50.  
  51.  
  52. /*================== Header.php ======================== */
  53.  
  54. <html <?php language_attributes(); ?>>
  55. <head>
  56. <meta charset="<?php bloginfo( 'charset' ); ?>">
  57. <meta name="viewport" content="width=device-width, initial-scale=1">
  58. <link rel="profile" href="http://gmpg.org/xfn/11">
  59.  
  60. <?php
  61.  
  62. $stock_header_socialicon = cs_get_option('stock_header_socialicon');
  63. $stock_header_contact = cs_get_option('stock_header_contact');
  64. $enable_logo_image = cs_get_option('enable_logo_image');
  65. $stock_img_logo = cs_get_option('stock_img_logo');
  66. $stock_img_logo_height = cs_get_option('stock_img_logo_height');
  67. $stock_text_logo = cs_get_option('stock_text_logo');
  68.  
  69. $enable_preloaded = cs_get_option('enable_preloaded');
  70. $enable_box_layout = cs_get_option('enable_box_layout');
  71.  
  72.  
  73. $stock_header_script = cs_get_option('stock_header_script');
  74. $stock_body_script = cs_get_option('stock_body_script');
  75.  
  76. wp_head();
  77. echo $stock_header_script;
  78.  
  79. ?>
  80. </head>
  81.  
  82. <body <?php body_class(); ?> >
  83.  
  84. <?php echo $stock_body_script; ?>
  85.  
  86. <?php if($enable_preloaded == true) : ?>
  87. <!-- Preloader -->
  88.  
  89. <script>
  90. jQuery(window).load(function(){
  91. jQuery(".stock-preloader-wrap").fadeOut();
  92. });
  93.  
  94. </script>
  95. <div class="stock-preloader-wrap">
  96. <div class="loader">Loading...</div>
  97. </div>
  98. <?php endif; ?>
  99.  
  100.  
  101. <div id="page" class="site<?php if($enable_box_layout == true) : ?> stock-box-layout <?php endif; ?>">
  102.  
  103. <div class="header-area">
  104. <div class="container">
  105. <div class="row">
  106. <div class="col-md-6 col-xs-12">
  107. <div class="header-left-icon">
  108. <ul>
  109.  
  110. <?php
  111. if(!empty($stock_header_socialicon)){
  112. foreach($stock_header_socialicon as $socialicon){ ?>
  113. <li>
  114. <?php
  115. if(!empty($socialicon['stock_header_icon_link'])){ ?>
  116. <a href="<?php echo esc_url($socialicon['stock_header_icon_link']); ?>" target="_blank">
  117.  
  118. <?php } else{ ?>
  119. <div>
  120. <?php }
  121. ?>
  122. <i class="<?php echo esc_attr($socialicon['stock_header_icon_field']); ?>"></i>
  123.  
  124. <?php
  125. if(!empty($socialicon['stock_header_icon_link'])){ ?>
  126. </a>
  127.  
  128. <?php } else{ ?>
  129. </div>
  130. <?php }
  131. ?>
  132.  
  133. </li>
  134. <?php }
  135. }
  136.  
  137. ?>
  138.  
  139. </ul>
  140. </div>
  141. </div>
  142.  
  143. <div class="col-md-6 col-xs-12">
  144. <div class="header-right-contect">
  145.  
  146.  
  147. <?php
  148. if(!empty($stock_header_contact)){
  149. foreach($stock_header_contact as $contact){ ?>
  150. <div class="mail">
  151. <?php
  152. if(!empty($contact['cotact_icon_link'])){ ?>
  153. <a href="<?php echo esc_url($contact['cotact_icon_link']); ?>" target="_blank">
  154.  
  155. <?php } ?>
  156.  
  157. <i class="<?php echo esc_attr($contact['stock_contact_icon_field']); ?>"></i>
  158. <?php echo esc_html($contact['stock_contact_text_field']); ?>
  159.  
  160. <?php
  161. if(!empty($contact['cotact_icon_link'])){ ?>
  162. </a>
  163.  
  164. <?php } ?>
  165.  
  166. </div>
  167. <?php }
  168. }
  169.  
  170. ?>
  171.  
  172. </div>
  173. </div>
  174. </div>
  175.  
  176. </div>
  177. </div>
  178.  
  179. <!-- Main Menu -->
  180. <div class="container">
  181. <div class="row">
  182. <div class="col-md-4 col-xs-12">
  183. <div class="logo">
  184. <h1 class="site-title">
  185. <a href="<?php esc_url(home_url('/')); ?>">
  186.  
  187.  
  188. <?php if($enable_logo_image == true && !empty($stock_img_logo)) : $img_logo_src = wp_get_attachment_image_src($stock_img_logo, 'large', false) ; ?>
  189. <img style="max-height:<?php echo esc_attr($stock_img_logo_height); ?>px" src="<?php echo esc_url($img_logo_src[0]); ?>" alt="<?php echo esc_html(bloginfo('name')); ?>">
  190.  
  191. <?php else : ?>
  192. <?php if(!empty($stock_text_logo)) { echo esc_html($stock_text_logo); } else { echo esc_html(bloginfo('name')); } ?>
  193. <?php endif; ?>
  194.  
  195. </a>
  196. </h1>
  197. </div><!-- /.navbar-header -->
  198. </div>
  199.  
  200. <div class="col-md-8 col-xs-12">
  201.  
  202. <div class="stock-responsive-slicknav"> </div>
  203. <div class="mainmenu">
  204.  
  205. <?php
  206. wp_nav_menu(array(
  207. 'theme_location' => 'main_menu',
  208. 'menu_class' => 'nav navbar-nav stellarnav',
  209. 'menu_id' => 'main-nav',
  210. ));
  211. ?>
  212.  
  213. </div>
  214. </div><!-- /.row -->
  215. </div><!-- /.row -->
  216. </div><!-- /.row -->
  217.  
  218.  
  219. /*======================= index.php ==============================*/
  220. <div class="stock_breadcrumb_area">
  221. <div class="container">
  222. <div class="row">
  223. <div class="col-md-12">
  224. <h1> <?php esc_html_e('Blog', 'stock-crazycafe'); ?> </h1>
  225. </div>
  226. </div>
  227. </div>
  228. </div>
  229.  
  230.  
  231. /*============================= page.php ====================================*/
  232.  
  233. if(get_post_meta($post->ID, '_stock_page_title', true)){
  234. $page_title_enable_meta = get_post_meta($post->ID, '_stock_page_title', true);
  235. } else{
  236. $page_title_enable_meta = array();
  237. }
  238.  
  239.  
  240. if(array_key_exists('stock_title_show_hide', $page_title_enable_meta)){
  241. $page_enable = $page_title_enable_meta['stock_title_show_hide'];
  242. } else{
  243. $page_enable = true;
  244. }
  245.  
  246. if(array_key_exists('custom_title', $page_title_enable_meta)){
  247. $custom_title = $page_title_enable_meta['custom_title'];
  248. } else{
  249. $custom_title = '';
  250. }
  251.  
  252.  
  253. while ( have_posts() ) : the_post();
  254.  
  255. ?>
  256.  
  257.  
  258. <div <?php if(has_post_thumbnail()) : ?>style="background-image:url(<?php esc_url(the_post_thumbnail_url('large')); ?>)" <?php endif; ?> class="<?php if(!is_front_page()){ echo 'stock_breadcrumb_area';} ?>">
  259. <div class="container">
  260. <div class="row">
  261. <div class="col-md-12">
  262. <h1 class="entry-title">
  263. <?php
  264.  
  265. if(!empty($custom_title)){
  266. echo esc_html($custom_title);
  267. } else{
  268. if($page_enable == true){
  269. the_title();
  270. }
  271.  
  272. }
  273. ?>
  274. </h1>
  275.  
  276. <?php if(function_exists('bcn_display') && !is_front_page() &&!is_home()){ ?>
  277. <div class="breadcrumbs" typeof="BreadcrumbList" >
  278. <?php bcn_display(); ?>
  279. </div>
  280. <?php }
  281. ?>
  282.  
  283. </div>
  284.  
  285. </div>
  286. </div>
  287. </div>
  288.  
  289. <div class="stock_internal_area <?php echo esc_attr($vc_class); ?>">
  290. <div class="container">
  291. <div class="row">
  292. <div class="col-md-12">
  293. <?php
  294. get_template_part( 'template-parts/content', 'page' );
  295.  
  296. // If comments are open or we have at least one comment, load up the comment template.
  297. if ( comments_open() || get_comments_number() ) :
  298. comments_template();
  299. endif;
  300. ?>
  301.  
  302. </div>
  303.  
  304. </div>
  305. </div>
  306. </div>
  307.  
  308.  
  309. /*=============================== single.php ====================================*/
  310.  
  311. $vc_check = get_post_meta( $post->ID, '_wpb_vc_js_status', true);
  312.  
  313. if($vc_check == true){
  314. $vc_class ='';
  315. } else{
  316. $vc_class ='section-enable-padding';
  317. }
  318.  
  319.  
  320.  
  321. get_header(); ?>
  322.  
  323. <div <?php if(has_post_thumbnail()) : ?>style="background-image:url(<?php esc_url(the_post_thumbnail_url('large')); ?>)" <?php endif; ?> class="<?php if(!is_front_page()){ echo 'stock_breadcrumb_area';} ?>">
  324. <div class="container">
  325. <div class="row">
  326. <div class="col-md-12">
  327. <h1 class="entry-title"> <?php the_title();?> </h1>
  328.  
  329. <?php if(function_exists('bcn_display') && !is_front_page() &&!is_home() && get_post_type() != 'portfolio'){ ?>
  330. <div class="breadcrumbs" typeof="BreadcrumbList" >
  331. <?php bcn_display(); ?>
  332. </div>
  333. <?php }
  334. ?>
  335.  
  336. </div>
  337.  
  338. </div>
  339. </div>
  340. </div>
  341.  
  342.  
  343. <div class="stock_internal_area <?php echo esc_attr($vc_class); ?>">
  344. <div class="container">
  345. <div class="row">
  346.  
  347. <?php
  348. if(get_post_type()=='portfolio' && is_active_sidebar( 'stock_portfolio' )) : ?>
  349.  
  350. <div class="col-md-4">
  351. <div class="portfolio-widget">
  352. <?php
  353. dynamic_sidebar('stock_portfolio');
  354. ?>
  355. </div>
  356. </div>
  357.  
  358. <?php endif;
  359. // widget column logic end
  360.  
  361.  
  362. /* if(is_active_sidebar('stock_portfolio') or is_active_sidebar('sidebar-1')){
  363. $column_width = 'col-md-8';
  364. } else {
  365. $column_width = 'col-md-10 col-md-offset-1';
  366. } */
  367.  
  368.  
  369. if(get_post_type() == 'portfolio'){
  370. if(is_active_sidebar('stock_portfolio')){
  371. $column_width = 'col-md-8';
  372. } else {
  373. $column_width = 'col-md-10 col-md-offset-1';
  374. }
  375. } else {
  376. $column_width = 'col-md-8';
  377. }
  378.  
  379. ?>
  380. <div class="<?php echo esc_attr($column_width); ?>">
  381.  
  382. <?php
  383. while ( have_posts() ) : the_post();
  384.  
  385.  
  386. $blog_single_post_link = cs_get_option('blog_single_post_link');
  387.  
  388. get_template_part( 'template-parts/content', get_post_format() );
  389.  
  390. if(get_post_type() != 'portfolio') { if(isset($blog_single_post_link) && $blog_single_post_link == true) { the_post_navigation(); } } ?>
  391.  
  392. </div>
  393. <?php
  394.  
  395. // If comments are open or we have at least one comment, load up the comment template.
  396. if ( comments_open() || get_comments_number() ) :
  397. comments_template();
  398. endif;
  399.  
  400. endwhile; // End of the loop.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement