/library/functions/basic-functions.php

  1. <?php 
  2. /** Theme Setup Functions */ 
  3.  
  4. function evolve_after_setup() { 
  5.  
  6. add_theme_support('automatic-feed-links'); 
  7. add_theme_support('post-thumbnails'); 
  8. add_theme_support('title-tag'); 
  9. add_image_size('post-thumbnail', 680, 330, true); 
  10. add_image_size('slider-thumbnail', 400, 280, true); 
  11. add_image_size('tabs-img', 50, 50, true); 
  12. add_editor_style('editor-style.css'); 
  13.  
  14. if (version_compare($GLOBALS['wp_version'], '4.1', '<')) : 
  15.  
  16. /** 
  17. * Filters wp_title to print a neat <title> tag based on what is being viewed. 
  18. * 
  19. * @param string $title Default title text for current view. 
  20. * @param string $sep Optional separator. 
  21. * 
  22. * @return string The filtered title. 
  23. */ 
  24. function evolve_wp_title($title, $sep) { 
  25. if (is_feed()) { 
  26. return $title; 
  27. global $page, $paged; 
  28.  
  29. // Add the blog name 
  30. $title .= get_bloginfo('name', 'display'); 
  31.  
  32. // Add the blog description for the home/front page. 
  33. $site_description = get_bloginfo('description', 'display'); 
  34. if ($site_description && ( is_home() || is_front_page() )) { 
  35. $title .= " $sep $site_description"; 
  36.  
  37. // Add a page number if necessary: 
  38. if (( $paged >= 2 || $page >= 2 ) && !is_404()) { 
  39. $title .= " $sep " . sprintf(__('Page %s', 'evolve'), max($paged, $page)); 
  40.  
  41. return $title; 
  42.  
  43. add_filter('wp_title', 'evolve_wp_title', 10, 2); 
  44.  
  45. /** 
  46. * Title shim for sites older than WordPress 4.1. 
  47. * 
  48. * @link https://make.wordpress.org/core/2014/10/29/title-tags-in-4-1/ 
  49. * @todo Remove this function when WordPress 4.3 is released. 
  50. */ 
  51. function evolve_render_title() { 
  52. ?> 
  53. <title><?php wp_title('-', true, 'right'); ?></title> 
  54. <?php 
  55.  
  56. add_action('wp_head', 'evolve_render_title'); 
  57. endif; 
  58.  
  59. $evolve_width_px = evolve_get_option('evl_width_px', '1200'); 
  60. $evolve_width_px = apply_filters('evolve_header_image_width', $evolve_width_px); 
  61. //define( 'HEADER_IMAGE_WIDTH', apply_filters( 'evolve_header_image_width', $evolve_width_px ) ); 
  62. //define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'evolve_header_image_height', 170 ) ); 
  63. //define( 'HEADER_TEXTCOLOR', '' ); 
  64. //define( 'NO_HEADER_TEXT', true ); 
  65. //mod by denzel, allow flexible width and flexible height. 
  66. $args = array( 
  67. 'flex-width' => true,  
  68. 'width' => $evolve_width_px,  
  69. 'flex-height' => true,  
  70. 'height' => 200,  
  71. 'header-text' => false,  
  72. ); 
  73. add_theme_support('custom-header', $args); 
  74.  
  75.  
  76. $evolve_width_layout = evolve_get_option('evl_width_layout', 'fixed'); 
  77.  
  78. if ($evolve_width_layout == "fixed") { 
  79. $defaults = array( 
  80. 'default-color' => 'e5e5e5',  
  81. 'default-image' => '' 
  82. ); 
  83. add_theme_support('custom-background', $defaults); 
  84.  
  85. add_theme_support('post-formats', array( 
  86. 'aside',  
  87. 'audio',  
  88. 'chat',  
  89. 'gallery',  
  90. 'image',  
  91. 'link',  
  92. 'quote',  
  93. 'status',  
  94. 'video' 
  95. )); 
  96.  
  97. load_theme_textdomain('evolve', get_template_directory() . '/languages'); 
  98.  
  99. register_nav_menu('primary-menu', __('Primary Menu', 'evolve')); 
  100.  
  101. $evolve_layout = evolve_get_option('evl_layout', '2cr'); 
  102. $evolve_width_layout = evolve_get_option('evl_width_layout', 'fixed'); 
  103.  
  104. global $content_width; 
  105.  
  106. if ($evolve_layout == "2cl" || $evolve_layout == "2cr") { 
  107. if (!isset($content_width)) { 
  108. $content_width = 610; 
  109. if (( $evolve_layout == "3cl" || $evolve_layout == "3cr" ) || 
  110. ( $evolve_layout == "3cm" ) 
  111. ) { 
  112. if (!isset($content_width)) { 
  113. $content_width = 506; 
  114. if ($evolve_layout == "1c") { 
  115. if (!isset($content_width)) { 
  116. $content_width = 955; 
  117.  
  118. add_action('after_setup_theme', 'evolve_after_setup'); 
  119.  
  120. /** 
  121. * bbPress Integration 
  122. * 
  123. * @since 3.1.5 
  124. */ 
  125.  
  126. load_theme_textdomain('evolve', get_template_directory() . '/languages'); 
  127.  
  128. /** 
  129. * Functions - Evolve gatekeeper 
  130. * This file defines a few constants variables, loads up the core Evolve file,  
  131. * and finally initialises the main WP Evolve Class. 
  132. * 
  133. * @package EvoLve 
  134. * @subpackage Functions 
  135. */ 
  136. /** Blast you red baron! Initialise WP Evolve */ 
  137. get_template_part('library/evolve'); 
  138. WPevolve::init(); 
  139.  
  140. get_template_part('library/functions/tabs-widget'); 
  141.  
  142. /** evolve_truncate */ 
  143.  
  144. function evolve_truncate($str, $length = 10, $trailing = '..') { 
  145. $length -= mb_strlen($trailing); 
  146. if (mb_strlen($str) > $length) { 
  147. return mb_substr($str, 0, $length) . $trailing; 
  148. } else { 
  149. $res = $str; 
  150.  
  151. return $res; 
  152.  
  153. /** evolve_excerpt_max_charlength */ 
  154.  
  155. function evolve_excerpt_max_charlength($num) { 
  156. $limit = $num + 1; 
  157. $excerpt = explode(' ', get_the_excerpt(), $limit); 
  158. array_pop($excerpt); 
  159. $excerpt = implode(" ", $excerpt) . " [...]"; 
  160. echo $excerpt; 
  161.  
  162. /** Get first image */ 
  163.  
  164. function evolve_get_first_image() { 
  165. global $post, $posts; 
  166. $first_img = ''; 
  167. $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); 
  168. if (isset($matches[1][0])) { 
  169. $first_img = $matches [1][0]; 
  170.  
  171. return $first_img; 
  172.  
  173. // Tiny URL 
  174.  
  175. function evolve_tinyurl($url) { 
  176. $response = esc_url(wp_remote_retrieve_body(wp_remote_get('http://tinyurl.com/api-create.php?url=' . $url))); 
  177.  
  178. return $response; 
  179.  
  180. // Similar Posts 
  181.  
  182. function evolve_similar_posts() { 
  183.  
  184. $post = ''; 
  185. $orig_post = $post; 
  186. global $post; 
  187. $evolve_similar_posts = evolve_get_option('evl_similar_posts', 'disable'); 
  188.  
  189. if ($evolve_similar_posts == "category") { 
  190. $matchby = get_the_category($post->ID); 
  191. $matchin = 'category'; 
  192. } else { 
  193. $matchby = wp_get_post_tags($post->ID); 
  194. $matchin = 'tag'; 
  195.  
  196. if ($matchby) { 
  197. $matchby_ids = array(); 
  198. foreach ($matchby as $individual_matchby) { 
  199. $matchby_ids[] = $individual_matchby->term_id; 
  200.  
  201. $args = array( 
  202. $matchin . '__in' => $matchby_ids,  
  203. 'post__not_in' => array($post->ID),  
  204. 'showposts' => 5, // Number of related posts that will be shown. 
  205. 'ignore_sticky_posts' => 1 
  206. ); 
  207.  
  208. $my_query = new wp_query($args); 
  209. if ($my_query->have_posts()) { 
  210. echo '<div class="similar-posts"><h5>' . __('Similar posts', 'evolve') . '</h5><ul>'; 
  211. while ($my_query->have_posts()) { 
  212. $my_query->the_post(); 
  213. ?> 
  214. <li> 
  215. <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link to', 'evolve'); ?> <?php the_title(); ?>"> 
  216. <?php 
  217. if (get_the_title()) { 
  218. $title = the_title('', '', false); 
  219. $evolve_posts_excerpt_title_length = intval(evolve_get_option('evl_posts_excerpt_title_length', '40')); 
  220. echo evolve_truncate($title, $evolve_posts_excerpt_title_length, '...'); 
  221. } else { 
  222. echo __("Untitled", "evolve"); 
  223. ?> 
  224. </a> 
  225. <?php if (get_the_content()) { ?> — 
  226. <small><?php echo evolve_excerpt_max_charlength(60); ?></small> <?php } ?> 
  227. </li> 
  228. <?php 
  229. echo '</ul></div>'; 
  230. $post = $orig_post; 
  231. wp_reset_query(); 
  232.  
  233. function evolve_footer_hooks() { 
  234.  
  235. if (is_page_template('contact.php')): 
  236. $status_gmap = evolve_get_option('evl_status_gmap', '1'); 
  237.  
  238. if ($status_gmap): 
  239.  
  240. $evolve_gmap_address = evolve_get_option('evl_gmap_address', 'Via dei Fori Imperiali'); 
  241. $evolve_gmap_type = evolve_get_option('evl_gmap_type', 'hybrid'); 
  242. $evolve_map_zoom_level = evolve_get_option('evl_map_zoom_level', '18'); 
  243. $evolve_map_scrollwheel = evolve_get_option('evl_map_scrollwheel', '0'); 
  244. $evolve_map_scale = evolve_get_option('evl_map_scale', '0'); 
  245. $evolve_map_zoomcontrol = evolve_get_option('evl_map_zoomcontrol', '0'); 
  246. $evolve_map_pin = evolve_get_option('evl_map_pin', '0'); 
  247. $evolve_map_pop = evolve_get_option('evl_map_popup', '0'); 
  248. $evolve_gmap_address = addslashes($evolve_gmap_address); 
  249. $addresses = explode('|', $evolve_gmap_address); 
  250. $markers = ''; 
  251. if ($evolve_map_pop == '0') { 
  252. $map_popup = "false"; 
  253. } else { 
  254. $map_popup = "true"; 
  255. foreach ($addresses as $address_string) { 
  256. $markers .= "{ 
  257. address: '{$address_string}',  
  258. html: { 
  259. content: '{$address_string}',  
  260. popup: {$map_popup} 
  261. }, "; 
  262. ?> 
  263.  
  264. <script type='text/javascript'> 
  265. jQuery(document).ready( 
  266. function($) { 
  267. jQuery('#gmap').goMap( 
  268. address: '<?php echo $addresses[0]; ?>',  
  269. maptype: '<?php echo $evolve_gmap_type; ?>',  
  270. zoom: <?php echo $evolve_map_zoom_level; ?>,  
  271. scrollwheel: <?php if ($evolve_map_scrollwheel): ?>false<?php else: ?>true<?php endif; ?>,  
  272. scaleControl: <?php if ($evolve_map_scale): ?>false<?php else: ?>true<?php endif; ?>,  
  273. navigationControl: <?php if ($evolve_map_zoomcontrol): ?>false<?php else: ?>true<?php endif; ?>,  
  274. <?php if (!$evolve_map_pin): ?>markers: [<?php echo $markers; ?>], <?php endif; ?> 
  275. ); 
  276. );</script> 
  277. <?php 
  278. endif; 
  279. endif; 
  280. ?> 
  281.  
  282. <script type="text/javascript"> 
  283. var $jx = jQuery.noConflict(); 
  284. $jx("div.post").mouseover( 
  285. function() { 
  286. $jx(this).find("span.edit-post").css('visibility', 'visible'); 
  287. ).mouseout( 
  288. function() { 
  289. $jx(this).find("span.edit-post").css('visibility', 'hidden'); 
  290. ); 
  291. $jx("div.type-page").mouseover( 
  292. function() { 
  293. $jx(this).find("span.edit-page").css('visibility', 'visible'); 
  294. ).mouseout( 
  295. function() { 
  296. $jx(this).find("span.edit-page").css('visibility', 'hidden'); 
  297. ); 
  298. $jx("div.type-attachment").mouseover( 
  299. function() { 
  300. $jx(this).find("span.edit-post").css('visibility', 'visible'); 
  301. ).mouseout( 
  302. function() { 
  303. $jx(this).find("span.edit-post").css('visibility', 'hidden'); 
  304. ); 
  305. $jx("li.comment").mouseover( 
  306. function() { 
  307. $jx(this).find("span.edit-comment").css('visibility', 'visible'); 
  308. ).mouseout( 
  309. function() { 
  310. $jx(this).find("span.edit-comment").css('visibility', 'hidden'); 
  311. );</script> 
  312.  
  313. <?php 
  314. $evolve_sticky_header = evolve_get_option('evl_sticky_header', '1'); 
  315. $page_ID = get_queried_object_id(); 
  316. $evolve_slider_position = evolve_get_option('evl_slider_position', 'below'); 
  317. if ($evolve_sticky_header == "1" && get_post_meta($page_ID, 'evolve_slider_position', true) == 'above' || (get_post_meta($page_ID, 'evolve_slider_position', true) == 'default' && $evolve_slider_position == 'above') || (is_home() && $evolve_slider_position == 'above')) { 
  318. ?> 
  319.  
  320. <script type="text/javascript"> 
  321. jQuery(document).ready( 
  322. function ($) { 
  323. if (jQuery('.sticky-header').length >= 1) { 
  324. jQuery(window).scroll(function () { 
  325. var header = jQuery(document).scrollTop(); 
  326. var headerHeight = jQuery('.sliderblock').height() + jQuery('.new-top-menu').height() + jQuery('.menu-header').height() + jQuery('.header-pattern').height(); 
  327. if (header > headerHeight) { 
  328. jQuery('.sticky-header').addClass('sticky'); 
  329. jQuery('.sticky-header').show(); 
  330. } else { 
  331. jQuery('.sticky-header').removeClass('sticky'); 
  332. jQuery('.sticky-header').hide(); 
  333. }); 
  334. );</script> 
  335.  
  336. <?php 
  337. } elseif ($evolve_sticky_header == "1") { 
  338. ?> 
  339.  
  340. <script type="text/javascript"> 
  341. jQuery(document).ready( 
  342. function($) { 
  343. if (jQuery('.sticky-header').length >= 1) { 
  344. jQuery(window).scroll(function() { 
  345. var header = jQuery(document).scrollTop(); 
  346. var headerHeight = jQuery('.new-top-menu').height() + jQuery('.menu-header').height() + jQuery('.header-pattern').height(); 
  347. if (header > headerHeight) { 
  348. jQuery('.sticky-header').addClass('sticky'); 
  349. jQuery('.sticky-header').show(); 
  350. } else { 
  351. jQuery('.sticky-header').removeClass('sticky'); 
  352. jQuery('.sticky-header').hide(); 
  353. }); 
  354. );</script> 
  355.  
  356. <?php 
  357.  
  358. $evolve_animatecss = evolve_get_option('evl_animatecss', '1'); 
  359.  
  360. if ($evolve_animatecss == "1") { 
  361. ?> 
  362.  
  363. <script type="text/javascript"> 
  364. /*----------------------------*/ 
  365. /* Animated Buttons 
  366. /*----------------------------*/ 
  367.  
  368. var $animated = jQuery.noConflict(); 
  369. $animated('.post-more').hover( 
  370. function () { 
  371. $animated(this).addClass('animated pulse') 
  372. },  
  373. function () { 
  374. $animated(this).removeClass('animated pulse') 
  375. $animated('.read-more').hover( 
  376. function () { 
  377. $animated(this).addClass('animated pulse') 
  378. },  
  379. function () { 
  380. $animated(this).removeClass('animated pulse') 
  381. $animated('#submit').hover( 
  382. function () { 
  383. $animated(this).addClass('animated pulse') 
  384. },  
  385. function () { 
  386. $animated(this).removeClass('animated pulse') 
  387. $animated('input[type="submit"]').hover( 
  388. function () { 
  389. $animated(this).addClass('animated pulse') 
  390. },  
  391. function () { 
  392. $animated(this).removeClass('animated pulse') 
  393.  
  394. </script> 
  395.  
  396. <?php 
  397.  
  398. $evolve_carousel_slider = evolve_get_option('evl_carousel_slider', '1'); 
  399.  
  400. if ($evolve_carousel_slider == "1"): 
  401.  
  402. $evolve_carousel_speed = evolve_get_option('evl_carousel_speed', '3500'); 
  403. if (empty($evolve_carousel_speed)): $evolve_carousel_speed = '3500'; 
  404. endif; 
  405. ?> 
  406.  
  407. <script type="text/javascript"> 
  408. /*----------------*/ 
  409. /* AnythingSlider 
  410. /*----------------*/ 
  411. var $s = jQuery.noConflict(); 
  412. $s( 
  413. function() { 
  414. $s('#slides') 
  415. .anythingSlider({autoPlay: true, delay: <?php echo $evolve_carousel_speed; ?>, }) 
  416. </script> 
  417.  
  418. <?php 
  419. endif; 
  420.  
  421. $evolve_bootstrap_speed = evolve_get_option('evl_bootstrap_speed', '7000'); 
  422. if (empty($evolve_bootstrap_speed)): $evolve_bootstrap_speed = '7000'; 
  423. endif; 
  424.  
  425. $evolve_parallax_slider = evolve_get_option('evl_parallax_slider_support', '1'); 
  426.  
  427. if ($evolve_parallax_slider == "1"): 
  428.  
  429. $evolve_parallax_speed = evolve_get_option('evl_parallax_speed', '4000'); 
  430. if (empty($evolve_parallax_speed)): $evolve_parallax_speed = '4000'; 
  431. endif; 
  432. ?> 
  433. <script type="text/javascript"> 
  434. /*----------------*/ 
  435. /* Parallax Slider 
  436. /*----------------*/ 
  437.  
  438. var $par = jQuery.noConflict(); 
  439. $par('#da-slider').cslider( 
  440. autoplay: true,  
  441. bgincrement: 450,  
  442. interval: <?php echo $evolve_parallax_speed; ?> 
  443. );</script> 
  444.  
  445. <?php endif; ?> 
  446.  
  447. <script type="text/javascript"> 
  448. /*----------------------*/ 
  449. /* Bootstrap Slider 
  450. /*---------------------*/ 
  451.  
  452. var $carousel = jQuery.noConflict(); 
  453. $carousel('#myCarousel').carousel( 
  454. interval: 7000 
  455.  
  456. $carousel('#carousel-nav a').click( 
  457. function(q) { 
  458. q.preventDefault(); 
  459. targetSlide = $carousel(this).attr('data-to') - 1; 
  460. $carousel('#myCarousel').carousel(targetSlide); 
  461. $carousel(this).addClass('active').siblings().removeClass('active'); 
  462. ); 
  463. $carousel('#bootstrap-slider').carousel( 
  464. interval: <?php echo $evolve_bootstrap_speed; ?> 
  465.  
  466. $carousel('#carousel-nav a').click( 
  467. function (q) { 
  468. q.preventDefault(); 
  469. targetSlide = $carousel(this).attr('data-to') - 1; 
  470. $carousel('#bootstrap-slider').carousel(targetSlide); 
  471. $carousel(this).addClass('active').siblings().removeClass('active'); 
  472. ); 
  473. </script> 
  474.  
  475. <?php 
  476.  
  477. function evolve_hexDarker($hex, $factor = 30) { 
  478. $new_hex = ''; 
  479.  
  480. // if hex code null than assign transparent for hide PHP warning / 
  481. $hex = empty($hex) ? 'ransparent' : $hex; 
  482.  
  483. $base['R'] = hexdec($hex{0} . $hex{1}); 
  484. $base['G'] = hexdec($hex{2} . $hex{3}); 
  485. $base['B'] = hexdec($hex{4} . $hex{5}); 
  486.  
  487. foreach ($base as $k => $v) { 
  488. $amount = $v / 100; 
  489. $amount = round($amount * $factor); 
  490. $new_decimal = $v - $amount; 
  491.  
  492. $new_hex_component = dechex($new_decimal); 
  493. if (strlen($new_hex_component) < 2) { 
  494. $new_hex_component = "0" . $new_hex_component; 
  495. $new_hex .= $new_hex_component; 
  496.  
  497. return $new_hex; 
  498.  
  499. function evolve_enqueue_comment_reply() { 
  500. if (is_singular() && comments_open() && get_option('thread_comments')) { 
  501. wp_enqueue_script('comment-reply'); 
  502.  
  503. add_action('wp_enqueue_scripts', 'evolve_enqueue_comment_reply'); 
  504.  
  505. // Share This Buttons 
  506.  
  507. function evolve_sharethis() { 
  508. global $post; 
  509. $image_url = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); 
  510. if (empty($image_url)) { 
  511. $image_url = get_template_directory_uri() . '/assets/images/no-thumbnail.jpg'; 
  512. ?> 
  513. <div class="share-this"> 
  514. <a rel="nofollow" class="tipsytext" title="<?php _e('Share on Twitter', 'evolve'); ?>" target="_blank" href="http://twitter.com/intent/tweet?status=<?php the_title(); ?>+»+<?php echo esc_url(evolve_tinyurl(get_permalink())); ?>"><i class="t4p-icon-social-twitter"></i></a> 
  515. <a rel="nofollow" class="tipsytext" title="<?php _e('Share on Facebook', 'evolve'); ?>" target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>&t=<?php the_title(); ?>"><i class="t4p-icon-social-facebook"></i></a> 
  516. <a rel="nofollow" class="tipsytext" title="<?php _e('Share on Google Plus', 'evolve'); ?>" target="_blank" href="https://plus.google.com/share?url=<?php the_permalink(); ?>"><i class="t4p-icon-social-google-plus"></i></a> 
  517. <a rel="nofollow" class="tipsytext" title="<?php _e('Share on Pinterest', 'evolve'); ?>" target="_blank" href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php echo $image_url; ?>&description=<?php the_title(); ?>"><i class="t4p-icon-social-pinterest"></i></a>  
  518. <a rel="nofollow" class="tipsytext" title="<?php _e('Share by Email', 'evolve'); ?>" target="_blank" href="http://www.addtoany.com/email?linkurl=<?php the_permalink(); ?>&linkname=<?php the_title(); ?>"><i class="t4p-icon-social-envelope-o"></i></a> 
  519. <a rel="nofollow" class="tipsytext" title="<?php _e('More options', 'evolve'); ?>" target="_blank" href="http://www.addtoany.com/share_save#url=<?php the_permalink(); ?>&linkname=<?php the_title(); ?>"><i class="t4p-icon-redo"></i></a> 
  520. </div> 
  521. <?php 
  522.  
  523. /** Bootstrap Slider */ 
  524.  
  525. function evolve_bootstrap() { 
  526. global $evl_options; 
  527. $wrap = false; 
  528. for ($i = 1; $i <= 5; $i ++) { 
  529.  
  530. if ($evl_options["evl_bootstrap_slide{$i}"] == 1) { 
  531. $active = ""; 
  532. if (!$wrap) { 
  533. $wrap = true; 
  534. echo "<div id='bootstrap-slider' class='carousel slide' data-ride='carousel'>"; 
  535. echo "<div class='carousel-inner'>"; 
  536. $active = " active"; 
  537.  
  538. echo "<div class='item" . $active . "'>"; 
  539. echo "<img class='img-responsive' src='" . $evl_options["evl_bootstrap_slide{$i}_img"]['url'] . "' alt='" . $evl_options["evl_bootstrap_slide{$i}_title"] . "' />"; 
  540. if (( strlen($evl_options["evl_bootstrap_slide{$i}_title"]) > 0 ) || ( strlen($evl_options["evl_bootstrap_slide{$i}_desc"]) > 0 )) { 
  541. ?>  
  542. <div class="carousel-caption <?php echo evolve_bootstrap_layout_class(); ?>" > 
  543. <?php 
  544. if (strlen($evl_options["evl_bootstrap_slide{$i}_title"]) > 0) { 
  545. echo "<h2>" . esc_attr($evl_options["evl_bootstrap_slide{$i}_title"]) . "</h2>"; 
  546.  
  547. if (strlen($evl_options["evl_bootstrap_slide{$i}_desc"]) > 0) { 
  548. echo "<p>" . esc_attr($evl_options["evl_bootstrap_slide{$i}_desc"]) . "</p>"; 
  549.  
  550. echo do_shortcode($evl_options["evl_bootstrap_slide{$i}_button"]); 
  551.  
  552. echo "</div>"; 
  553. echo "</div>"; 
  554.  
  555. if ($wrap) { 
  556. echo "</div> 
  557. <a class='left carousel-control' href='#bootstrap-slider' data-slide='prev'></a><a class='right carousel-control' href='#bootstrap-slider' data-slide='next'></a></div>"; 
  558.  
  559. /** Function use for add css class in Bootstrap Slider */ 
  560.  
  561. function evolve_bootstrap_layout_class() { 
  562. $bootstrap_layout = ''; 
  563.  
  564. $evolve_bootstrap_layout = evolve_get_option('evl_bootstrap_layout', 'bootstrap_left'); 
  565.  
  566. if ($evolve_bootstrap_layout == "bootstrap_right") { 
  567. $bootstrap_layout = 'layout-right'; 
  568. } elseif ($evolve_bootstrap_layout == "bootstrap_center") { 
  569. $bootstrap_layout = 'layout-center'; 
  570. } else { 
  571. $bootstrap_layout = 'layout-left'; 
  572.  
  573. return $bootstrap_layout; 
  574.  
  575. /** Parallax Slider */ 
  576.  
  577. function evolve_parallax() { 
  578. global $evl_options; 
  579. if ($evl_options['evl_show_slide1'] == "1" || $evl_options['evl_show_slide2'] == "1" || $evl_options['evl_show_slide3'] == "1" || $evl_options['evl_show_slide4'] == "1" || $evl_options['evl_show_slide5'] == "1") { 
  580. echo "<div id='da-slider' class='da-slider'>"; 
  581.  
  582. for ($i = 1; $i <= 5; $i++) { 
  583. if ($evl_options["evl_show_slide{$i}"] == "1") { 
  584.  
  585. echo "<div class='da-slide'>"; 
  586.  
  587. echo "<h2>" . esc_attr($evl_options["evl_slide{$i}_title"]) . "</h2>"; 
  588.  
  589. echo "<p>" . esc_attr($evl_options["evl_slide{$i}_desc"]) . "</p>"; 
  590.  
  591. echo do_shortcode($evl_options["evl_slide{$i}_button"]); 
  592.  
  593. echo "<div class='da-img'><img class='img-responsive' src='" . $evl_options["evl_slide{$i}_img"]['url'] . "' alt='" . $evl_options["evl_slide{$i}_title"] . "' /></div>"; 
  594.  
  595. echo "</div>"; 
  596.  
  597. echo "<nav class='da-arrows'><span class='da-arrows-prev'></span><span class='da-arrows-next'></span></nav></div>"; 
  598.  
  599. /** Front Page Content Boxes */ 
  600.  
  601. function evolve_content_boxes() { 
  602.  
  603. $evolve_content_boxes = evolve_get_option('evl_content_boxes', '1'); 
  604. $evolve_content_box1_enable = evolve_get_option('evl_content_box1_enable', '1'); 
  605. if ($evolve_content_box1_enable === false) { 
  606. $evolve_content_box1_enable = ''; 
  607. $evolve_content_box2_enable = evolve_get_option('evl_content_box2_enable', '1'); 
  608. if ($evolve_content_box2_enable === false) { 
  609. $evolve_content_box2_enable = ''; 
  610. $evolve_content_box3_enable = evolve_get_option('evl_content_box3_enable', '1'); 
  611. if ($evolve_content_box3_enable === false) { 
  612. $evolve_content_box3_enable = ''; 
  613. $evolve_content_box4_enable = evolve_get_option('evl_content_box4_enable', '1'); 
  614. if ($evolve_content_box4_enable === false) { 
  615. $evolve_content_box4_enable = ''; 
  616. if ($evolve_content_boxes == "1") { 
  617.  
  618. echo "<div class='home-content-boxes'><div class='row'>"; 
  619.  
  620. $evolve_content_box1_title = evolve_get_option('evl_content_box1_title', 'Beautifully Simple'); 
  621. if ($evolve_content_box1_title === false) { 
  622. $evolve_content_box1_title = ''; 
  623. $evolve_content_box1_desc = evolve_get_option('evl_content_box1_desc', 'Clean modern theme with smooth and pixel perfect design focused on details'); 
  624. if ($evolve_content_box1_desc === false) { 
  625. $evolve_content_box1_desc = ''; 
  626. $evolve_content_box1_button = evolve_get_option('evl_content_box1_button', '<a class="read-more btn t4p-button" href="#">Learn more</a>'); 
  627. if ($evolve_content_box1_button === false) { 
  628. $evolve_content_box1_button = ''; 
  629. $evolve_content_box1_icon = evolve_get_option('evl_content_box1_icon', 'fa-cube'); 
  630. if ($evolve_content_box1_icon === false) { 
  631. $evolve_content_box1_icon = ''; 
  632.  
  633. /** 
  634. * Count how many boxes are enabled on frontpage 
  635. * Apply proper responsivity class 
  636. * 
  637. * @since 3.1.5 
  638. */ 
  639. $BoxCount = 0; // Box Counter 
  640.  
  641. if ($evolve_content_box1_enable == true) { 
  642. $BoxCount ++; 
  643. if ($evolve_content_box2_enable == true) { 
  644. $BoxCount ++; 
  645. if ($evolve_content_box3_enable == true) { 
  646. $BoxCount ++; 
  647. if ($evolve_content_box4_enable == true) { 
  648. $BoxCount ++; 
  649.  
  650. switch ($BoxCount): 
  651. case $BoxCount == 1: 
  652. $BoxClass = 'col-md-12'; 
  653. break; 
  654.  
  655. case $BoxCount == 2: 
  656. $BoxClass = 'col-md-6'; 
  657. break; 
  658.  
  659. case $BoxCount == 3: 
  660. $BoxClass = 'col-md-4'; 
  661. break; 
  662.  
  663. case $BoxCount == 4: 
  664. $BoxClass = 'col-md-3'; 
  665. break; 
  666.  
  667. default: 
  668. $BoxClass = 'col-md-3'; 
  669. endswitch; 
  670.  
  671. if ($evolve_content_box1_enable == true) { 
  672.  
  673. echo "<div class='col-sm-12 $BoxClass content-box content-box-1'>"; 
  674.  
  675. echo "<i class='fa " . $evolve_content_box1_icon . "'></i>"; 
  676.  
  677. echo "<h2>" . esc_attr($evolve_content_box1_title) . "</h2>"; 
  678.  
  679. echo "<p>" . do_shortcode($evolve_content_box1_desc) . "</p>"; 
  680.  
  681. echo "<div class='cntbox_btn sbtn1'>" . do_shortcode($evolve_content_box1_button) . "</div>"; 
  682.  
  683. echo "</div>"; 
  684.  
  685. $evolve_content_box2_title = evolve_get_option('evl_content_box2_title', 'Easy Customizable'); 
  686. if ($evolve_content_box2_title === false) { 
  687. $evolve_content_box2_title = ''; 
  688. $evolve_content_box2_desc = evolve_get_option('evl_content_box2_desc', 'Over a hundred theme options ready to make your website unique'); 
  689. if ($evolve_content_box2_desc === false) { 
  690. $evolve_content_box2_desc = ''; 
  691. $evolve_content_box2_button = evolve_get_option('evl_content_box2_button', '<a class="read-more btn t4p-button" href="#">Learn more</a>'); 
  692. if ($evolve_content_box2_button === false) { 
  693. $evolve_content_box2_button = ''; 
  694. $evolve_content_box2_icon = evolve_get_option('evl_content_box2_icon', 'fa-circle-o-notch'); 
  695. if ($evolve_content_box2_icon === false) { 
  696. $evolve_content_box2_icon = ''; 
  697.  
  698. if ($evolve_content_box2_enable == true) { 
  699.  
  700. echo "<div class='col-sm-12 $BoxClass content-box content-box-2'>"; 
  701.  
  702. echo "<i class='fa " . $evolve_content_box2_icon . "'></i>"; 
  703.  
  704. echo "<h2>" . esc_attr($evolve_content_box2_title) . "</h2>"; 
  705.  
  706. echo "<p>" . do_shortcode($evolve_content_box2_desc) . "</p>"; 
  707.  
  708. echo "<div class='cntbox_btn sbtn2'>" . do_shortcode($evolve_content_box2_button) . "</div>"; 
  709.  
  710. echo "</div>"; 
  711.  
  712.  
  713. $evolve_content_box3_title = evolve_get_option('evl_content_box3_title', 'Contact Form Ready'); 
  714. if ($evolve_content_box3_title === false) { 
  715. $evolve_content_box3_title = ''; 
  716. $evolve_content_box3_desc = evolve_get_option('evl_content_box3_desc', 'Built-In Contact Page with Google Maps is a standard for this theme'); 
  717. if ($evolve_content_box3_desc === false) { 
  718. $evolve_content_box3_desc = ''; 
  719. $evolve_content_box3_button = evolve_get_option('evl_content_box3_button', '<a class="read-more btn t4p-button" href="#">Learn more</a>'); 
  720. if ($evolve_content_box3_button === false) { 
  721. $evolve_content_box3_button = ''; 
  722. $evolve_content_box3_icon = evolve_get_option('evl_content_box3_icon', 'fa-send'); 
  723. if ($evolve_content_box3_icon === false) { 
  724. $evolve_content_box3_icon = ''; 
  725.  
  726. if ($evolve_content_box3_enable == true) { 
  727.  
  728. echo "<div class='col-sm-12 $BoxClass content-box content-box-3'>"; 
  729.  
  730. echo "<i class='fa " . $evolve_content_box3_icon . "'></i>"; 
  731.  
  732. echo "<h2>" . esc_attr($evolve_content_box3_title) . "</h2>"; 
  733.  
  734. echo "<p>" . do_shortcode($evolve_content_box3_desc) . "</p>"; 
  735.  
  736. echo "<div class='cntbox_btn sbtn3'>" . do_shortcode($evolve_content_box3_button) . "</div>"; 
  737.  
  738. echo "</div>"; 
  739.  
  740. $evolve_content_box4_title = evolve_get_option('evl_content_box4_title', 'Modern Blog Layouts'); 
  741. if ($evolve_content_box4_title === false) { 
  742. $evolve_content_box4_title = ''; 
  743. $evolve_content_box4_desc = evolve_get_option('evl_content_box4_desc', 'Up to 3 Blog Layouts, responsive on all media devices'); 
  744. if ($evolve_content_box4_desc === false) { 
  745. $evolve_content_box4_desc = ''; 
  746. $evolve_content_box4_button = evolve_get_option('evl_content_box4_button', '<a class="read-more btn t4p-button" href="#">Learn more</a>'); 
  747. if ($evolve_content_box4_button === false) { 
  748. $evolve_content_box4_button = ''; 
  749. $evolve_content_box4_icon = evolve_get_option('evl_content_box4_icon', 'fa-tablet'); 
  750. if ($evolve_content_box4_icon === false) { 
  751. $evolve_content_box4_icon = ''; 
  752.  
  753. if ($evolve_content_box4_enable == true) { 
  754.  
  755. echo "<div class='col-sm-12 $BoxClass content-box content-box-4'>"; 
  756.  
  757. echo "<i class='fa " . $evolve_content_box4_icon . "'></i>"; 
  758.  
  759. echo "<h2>" . esc_attr($evolve_content_box4_title) . "</h2>"; 
  760.  
  761. echo "<p>" . do_shortcode($evolve_content_box4_desc) . "</p>"; 
  762.  
  763. echo "<div class='cntbox_btn sbtn4'>" . do_shortcode($evolve_content_box4_button) . "</div>"; 
  764.  
  765. echo "</div>"; 
  766. echo "</div></div><div class='clearfix'></div>"; 
  767.  
  768. /** 
  769. * evolve_Walker_Nav_Menu 
  770. */ 
  771. class evolve_Walker_Nav_Menu extends Walker_Nav_Menu { 
  772. /** 
  773. * @see Walker::start_lvl() 
  774. * @since 3.0.0 
  775. * 
  776. * @param string $output Passed by reference. Used to append additional content. 
  777. * @param int $depth Depth of page. Used for padding. 
  778. */ 
  779.  
  780. /** 
  781. * @see Walker::start_el() 
  782. * @since 3.0.0 
  783. * 
  784. * @param string $output Passed by reference. Used to append additional content. 
  785. * @param object $item Menu item data object. 
  786. * @param int $depth Depth of menu item. Used for padding. 
  787. * @param int $current_page Menu item ID. 
  788. * @param object $args 
  789. */ 
  790. public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { 
  791. $indent = ( $depth ) ? str_repeat("\t", $depth) : ''; 
  792.  
  793. /** 
  794. * Dividers, Headers or Disabled 
  795. * ============================= 
  796. * Determine whether the item is a Divider, Header, Disabled or regular 
  797. * menu item. To prevent errors we use the strcasecmp() function to so a 
  798. * comparison that is not case sensitive. The strcasecmp() function returns 
  799. * a 0 if the strings are equal. 
  800. */ 
  801. $class_names = $value = ''; 
  802.  
  803. $classes = empty($item->classes) ? array() : (array) $item->classes; 
  804. $classes[] = 'menu-item-' . $item->ID; 
  805.  
  806. $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args)); 
  807.  
  808. if ($args->has_children) { 
  809. $class_names .= ' dropdown'; 
  810.  
  811. if (in_array('current-menu-item', $classes)) { 
  812. $class_names .= ' active'; 
  813.  
  814. $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : ''; 
  815.  
  816. $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args); 
  817. $id = $id ? ' id="' . esc_attr($id) . '"' : ''; 
  818.  
  819. $output .= $indent . '<li' . $id . $value . $class_names . '>'; 
  820.  
  821. /** 
  822. * PolyLang Broken Flag Images - Fix 
  823. * ================================= 
  824. * 
  825. * @by jerry 
  826. * @since 3.2.0 
  827. * @todo find better solution 
  828. */ 
  829. $item->title_2 = $item->title; // Let's take flag image 
  830. if (class_exists('Polylang')) { 
  831. if (preg_match('/<img src=/', $item->title)) { 
  832. $item->title = strip_tags($item->title); // Let's remove flag image 
  833.  
  834. $atts = array(); 
  835. $atts['title'] = !empty($item->title) ? $item->title : ''; 
  836. $atts['target'] = !empty($item->target) ? $item->target : ''; 
  837. $atts['rel'] = !empty($item->xfn) ? $item->xfn : ''; 
  838. $atts['href'] = !empty($item->url) ? $item->url : ''; 
  839.  
  840.  
  841. $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args); 
  842.  
  843. $attributes = ''; 
  844. foreach ($atts as $attr => $value) { 
  845. if (!empty($value)) { 
  846. $value = ( 'href' === $attr ) ? esc_url($value) : esc_attr($value); 
  847. $attributes .= ' ' . $attr . '="' . $value . '"'; 
  848.  
  849. $item_output = $args->before; 
  850.  
  851. /** 
  852. * Glyphicons 
  853. * =========== 
  854. * Since the the menu item is NOT a Divider or Header we check the see 
  855. * if there is a value in the attr_title property. If the attr_title 
  856. * property is NOT null we apply it as the class name for the glyphicon. 
  857. */ 
  858. if (evolve_get_option('evl_main_menu_hover_effect', 'rollover') == 'disable') { 
  859. $item_output .= '<a' . $attributes . '>'; 
  860. } else { 
  861. $item_output .= '<a' . $attributes . '><span data-hover="' . $item->title . '">'; 
  862.  
  863. $item_output .= $args->link_before . apply_filters('the_title', $item->title_2, $item->ID) . $args->link_after; 
  864. $item_output .= ( $args->has_children && 0 === $depth ) ? ' <span class="arrow"></span>' : ''; 
  865. if (evolve_get_option('evl_main_menu_hover_effect', 'rollover') == 'disable') { 
  866. $item_output .= '</a>'; 
  867. } else { 
  868. $item_output .= '</span></a>'; 
  869. $item_output .= $args->after; 
  870.  
  871. $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); 
  872.  
  873. /** 
  874. * Traverse elements to create list from elements. 
  875. * Display one element if the element doesn't have any children otherwise,  
  876. * display the element and its children. Will only traverse up to the max 
  877. * depth and no ignore elements under that depth. 
  878. * This method shouldn't be called directly, use the walk() method instead. 
  879. * 
  880. * @see Walker::start_el() 
  881. * @since 2.5.0 
  882. * 
  883. * @param object $element Data object 
  884. * @param array $children_elements List of elements to continue traversing. 
  885. * @param int $max_depth Max depth to traverse. 
  886. * @param int $depth Depth of current element. 
  887. * @param array $args 
  888. * @param string $output Passed by reference. Used to append additional content. 
  889. * 
  890. * @return null Null on failure with no changes to parameters. 
  891. */ 
  892. public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output) { 
  893. if (!$element) { 
  894. return; 
  895.  
  896. $id_field = $this->db_fields['id']; 
  897.  
  898. // Display this element. 
  899. if (is_object($args[0])) { 
  900. $args[0]->has_children = !empty($children_elements[$element->$id_field]); 
  901.  
  902. parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output); 
  903.  
  904.  
  905. //end evolve_Walker_Nav_Menu 
  906. // Breadcrumbs // 
  907.  
  908. function evolve_breadcrumb() { 
  909. global $data, $post; 
  910.  
  911. echo '<ul class="breadcrumbs">'; 
  912.  
  913. echo '<li><a class="home" href="'; 
  914. echo home_url(); 
  915. echo '">' . __('Home', 'evolve'); 
  916. echo "</a></li>"; 
  917.  
  918. $params['link_none'] = ''; 
  919. $separator = ''; 
  920.  
  921. if (is_category()) { 
  922. $category = get_the_category(); 
  923. $ID = $category[0]->cat_ID; 
  924. echo is_wp_error($cat_parents = get_category_parents($ID, TRUE, '', FALSE)) ? '' : '<li>' . $cat_parents . '</li>'; 
  925.  
  926. if (is_tax()) { 
  927. $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); 
  928. echo '<li>' . $term->name . '</li>'; 
  929.  
  930. if (is_home()) { 
  931. echo '<li>' . __('Blog', 'evolve') . '</li>'; 
  932. if (is_page() && !is_front_page()) { 
  933. $parents = array(); 
  934. $parent_id = $post->post_parent; 
  935. while ($parent_id) : 
  936. $page = get_page($parent_id); 
  937. if ($params["link_none"]) { 
  938. $parents[] = get_the_title($page->ID); 
  939. } else { 
  940. $parents[] = '<li><a href="' . get_permalink($page->ID) . '" title="' . get_the_title($page->ID) . '">' . get_the_title($page->ID) . '</a></li>' . $separator; 
  941. $parent_id = $page->post_parent; 
  942. endwhile; 
  943. $parents = array_reverse($parents); 
  944. echo join(' ', $parents); 
  945. echo '<li>' . get_the_title() . '</li>'; 
  946. if (is_single() && !is_attachment()) { 
  947. $cat_1_line = ''; 
  948. $categories_1 = get_the_category($post->ID); 
  949. if ($categories_1): 
  950. foreach ($categories_1 as $cat_1): 
  951. $cat_1_ids[] = $cat_1->term_id; 
  952. endforeach; 
  953. $cat_1_line = implode(', ', $cat_1_ids); 
  954. endif; 
  955. $categories = get_categories(array( 
  956. 'include' => $cat_1_line,  
  957. 'orderby' => 'id' 
  958. )); 
  959. if ($categories) : 
  960. foreach ($categories as $cat) : 
  961. $cats[] = '<li><a href="' . get_category_link($cat->term_id) . '" title="' . $cat->name . '">' . $cat->name . '</a></li>'; 
  962. endforeach; 
  963. echo join(' ', $cats); 
  964. endif; 
  965. echo '<li>' . get_the_title() . '</li>'; 
  966. if (is_tag()) { 
  967. echo '<li>' . "Tag: " . single_tag_title('', false) . '</li>'; 
  968. if (is_404()) { 
  969. echo '<li>' . __("404 - Page not Found", 'evolve') . '</li>'; 
  970. if (is_search()) { 
  971. echo '<li>' . __("Search", 'evolve') . '</li>'; 
  972. if (is_year()) { 
  973. echo '<li>' . get_the_time('Y') . '</li>'; 
  974. if (is_attachment()) { 
  975. if (!empty($post->post_parent)) { 
  976. echo "<li><a href='" . get_permalink($post->post_parent) . "'>" . get_the_title($post->post_parent) . "</a></li>"; 
  977. echo "<li>" . get_the_title() . "</li>"; 
  978.  
  979. echo "</ul>"; 
  980.  
  981. function evolve_posts_slider() { 
  982. ?> 
  983. <div id="slide_holder"> 
  984. <div class="slide-container"> 
  985.  
  986. <ul id="slides"> 
  987.  
  988. <?php 
  989. $number_items = evolve_get_option('evl_posts_number', '5'); 
  990. $slider_content = evolve_get_option('evl_posts_slider_content', 'recent'); 
  991. $slider_content_category = ''; 
  992. $slider_content_category = evolve_get_option('evl_posts_slider_id', ''); 
  993. //make array categories into string with commas. 
  994. if (is_array($slider_content_category)) { 
  995. $slider_content_category = implode(", ", $slider_content_category); 
  996.  
  997. if ($slider_content == "category" && !empty($slider_content_category)) { 
  998. $slider_content_ID = $slider_content_category; 
  999. } else { 
  1000. $slider_content_ID = ''; 
  1001.  
  1002. $args = array( 
  1003. 'cat' => $slider_content_ID,  
  1004. 'showposts' => $number_items,  
  1005. 'ignore_sticky_posts' => 1,  
  1006. ); 
  1007. query_posts($args); 
  1008.  
  1009. if (have_posts()) : $featured = new WP_Query($args); 
  1010. while ($featured->have_posts()) : $featured->the_post(); 
  1011. ?> 
  1012.  
  1013. <li class="slide"> 
  1014.  
  1015. <?php 
  1016. if (has_post_thumbnail()) { 
  1017. echo '<div class="featured-thumbnail"><a href="'; 
  1018. the_permalink(); 
  1019. echo '">'; 
  1020. the_post_thumbnail('slider-thumbnail'); 
  1021. echo '</a></div>'; 
  1022. } else { 
  1023. $image = evolve_get_first_image(); 
  1024. if ($image): 
  1025. echo '<div class="featured-thumbnail"><a href="'; 
  1026. the_permalink(); 
  1027. echo '"><img src="' . $image . '" alt="'; 
  1028. the_title(); 
  1029. echo '" /></a></div>'; 
  1030. endif; 
  1031. ?> 
  1032.  
  1033. <h2 class="featured-title"> 
  1034. <a class="title" href="<?php the_permalink() ?>"> 
  1035. <?php 
  1036. $title = the_title('', '', false); 
  1037. $length = evolve_get_option('evl_posts_slider_title_length', 40); 
  1038. echo evolve_truncate($title, $length, '...'); 
  1039. ?> 
  1040. </a> 
  1041. </h2> 
  1042.  
  1043. <p><?php 
  1044. $excerpt_length = evolve_get_option('evl_posts_slider_excerpt_length', 40); 
  1045. echo evolve_excerpt_max_charlength($excerpt_length); 
  1046. ?></p> 
  1047. <a class="button post-more" href="<?php the_permalink(); ?>"><?php _e('Read More', 'evolve'); ?></a> 
  1048.  
  1049. </li> 
  1050.  
  1051. <?php 
  1052. endwhile; 
  1053. else: 
  1054. ?> 
  1055. <li><?php _e('<h2 style="color:#fff;">Oops, no posts to display! Please check your post slider Category (ID) settings</h2>', 'evolve'); ?></li> 
  1056.  
  1057. <?php 
  1058. endif; 
  1059. wp_reset_query(); 
  1060. ?> 
  1061. </ul> 
  1062. </div> 
  1063. </div> 
  1064. <?php 
  1065.  
  1066. // Woocommerce Support 
  1067. add_theme_support('woocommerce'); 
  1068. add_filter('woocommerce_enqueue_styles', '__return_false'); 
  1069.  
  1070. /** 
  1071. * Remove Double Cart Totals 
  1072. * ========================= 
  1073. * 
  1074. * @woocommerce 
  1075. * @bugfix 
  1076. * @jerry 
  1077. */ 
  1078. if (class_exists('Woocommerce')) { 
  1079. remove_action('woocommerce_cart_collaterals', 'woocommerce_cart_totals', 10); // Remove Duplicated Cart Totals 
  1080. remove_action('woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20); // Remove Duplicated Checkout Button 
  1081.  
  1082. // Register default function when plugin not activated 
  1083. add_action('wp_head', 'evolve_plugins_loaded'); 
  1084.  
  1085. function evolve_plugins_loaded() { 
  1086. if (!function_exists('is_woocommerce')) { 
  1087.  
  1088. function is_woocommerce() { 
  1089. return false; 
  1090.  
  1091. if (!function_exists('is_product')) { 
  1092.  
  1093. function is_product() { 
  1094. return false; 
  1095.  
  1096. if (!function_exists('is_buddypress')) { 
  1097.  
  1098. function is_buddypress() { 
  1099. return false; 
  1100.  
  1101. if (!function_exists('is_bbpress')) { 
  1102.  
  1103. function is_bbpress() { 
  1104. return false; 
  1105.  
  1106.  
  1107. /** 
  1108. * Woo Config 
  1109. */ 
  1110. include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 
  1111.  
  1112. if (is_plugin_active('woocommerce/woocommerce.php')) { 
  1113.  
  1114. include_once( get_template_directory() . '/library/woo-config.php' ); 
  1115.  
  1116. if (!function_exists('t4p_addURLParameter')) { 
  1117.  
  1118. function t4p_addURLParameter($url, $paramName, $paramValue) { 
  1119. $url_data = parse_url($url); 
  1120. if (!isset($url_data["query"])) { 
  1121. $url_data["query"] = ""; 
  1122.  
  1123. $params = array(); 
  1124. parse_str($url_data['query'], $params); 
  1125. $params[$paramName] = $paramValue; 
  1126.  
  1127. if ($paramName == 'product_count') { 
  1128. $params['paged'] = '1'; 
  1129. $url_data['query'] = http_build_query($params); 
  1130.  
  1131. return t4p_build_url($url_data); 
  1132.  
  1133.  
  1134. function t4p_build_url($url_data) { 
  1135. $url = ""; 
  1136. if (isset($url_data['host'])) { 
  1137. $url .= $url_data['scheme'] . '://'; 
  1138. if (isset($url_data['user'])) { 
  1139. $url .= $url_data['user']; 
  1140. if (isset($url_data['pass'])) { 
  1141. $url .= ':' . $url_data['pass']; 
  1142. $url .= '@'; 
  1143. $url .= $url_data['host']; 
  1144. if (isset($url_data['port'])) { 
  1145. $url .= ':' . $url_data['port']; 
  1146. if (isset($url_data['path'])) { 
  1147. $url .= $url_data['path']; 
  1148. if (isset($url_data['query'])) { 
  1149. $url .= '?' . $url_data['query']; 
  1150. if (isset($url_data['fragment'])) { 
  1151. $url .= '#' . $url_data['fragment']; 
  1152.  
  1153. return $url; 
  1154.  
  1155. ////////////////////////////////////////////////////////////////// 
  1156. // Woo Products Shortcode Recode 
  1157. ////////////////////////////////////////////////////////////////// 
  1158. function evolve_woo_product($atts, $content = null) { 
  1159. global $woocommerce_loop; 
  1160.  
  1161. if (empty($atts)) { 
  1162. return; 
  1163.  
  1164. $args = array( 
  1165. 'post_type' => 'product',  
  1166. 'posts_per_page' => 1,  
  1167. 'no_found_rows' => 1,  
  1168. 'post_status' => 'publish',  
  1169. 'meta_query' => array( 
  1170. array( 
  1171. 'key' => '_visibility',  
  1172. 'value' => array('catalog', 'visible'),  
  1173. 'compare' => 'IN' 
  1174. ),  
  1175. 'columns' => 1 
  1176. ); 
  1177.  
  1178. if (isset($atts['sku'])) { 
  1179. $args['meta_query'][] = array( 
  1180. 'key' => '_sku',  
  1181. 'value' => $atts['sku'],  
  1182. 'compare' => '=' 
  1183. ); 
  1184.  
  1185. if (isset($atts['id'])) { 
  1186. $args['p'] = $atts['id']; 
  1187.  
  1188. ob_start(); 
  1189.  
  1190. if (isset($columns)) { 
  1191. $woocommerce_loop['columns'] = $columns; 
  1192.  
  1193. $products = new WP_Query($args); 
  1194.  
  1195. if ($products->have_posts()) : 
  1196.  
  1197. woocommerce_product_loop_start(); 
  1198.  
  1199. while ($products->have_posts()) : $products->the_post(); 
  1200.  
  1201. woocommerce_get_template_part('content', 'product'); 
  1202.  
  1203. endwhile; // end of the loop.  
  1204.  
  1205. woocommerce_product_loop_end(); 
  1206.  
  1207. endif; 
  1208.  
  1209. wp_reset_postdata(); 
  1210.  
  1211. return '<div class="woocommerce">' . ob_get_clean() . '</div>'; 
  1212.  
  1213. /** 
  1214. * Infinite Scroll 
  1215. * 
  1216. * @since 3.2.0 
  1217. */ 
  1218. add_action('wp_footer', 'evolve_infinite_scroll_blog'); 
  1219.  
  1220. function evolve_infinite_scroll_blog() { 
  1221. echo '<script> 
  1222. if (jQuery(".posts-container-infinite").length == 1) { 
  1223. var ias = jQuery.ias({ 
  1224. container: ".posts-container-infinite",  
  1225. item: "div.post",  
  1226. pagination: "div.pagination",  
  1227. next: "a.pagination-next",  
  1228. }); 
  1229.  
  1230. ias.extension(new IASTriggerExtension({ 
  1231. text: "Load more items",  
  1232. offset: 99999 
  1233. })); 
  1234. ias.extension(new IASSpinnerExtension({ 
  1235. })); 
  1236. ias.extension(new IASNoneLeftExtension()); 
  1237. }else{'; 
  1238. $evolve_pagination_type = evolve_get_option('evl_pagination_type', 'pagination'); 
  1239. if ($evolve_pagination_type == "infinite" && !is_single() && (is_page_template('blog-page.php') || is_home() )) { 
  1240. echo ' 
  1241. var ias = jQuery.ias({ 
  1242. container: "#primary",  
  1243. item: ".post",  
  1244. pagination: ".navigation-links",  
  1245. next: ".nav-previous a",  
  1246. }); 
  1247.  
  1248. ias.extension(new IASTriggerExtension({ 
  1249. text: "Load more items",  
  1250. offset: 99999 
  1251. })); 
  1252. ias.extension(new IASSpinnerExtension({ 
  1253. })); 
  1254. ias.extension(new IASNoneLeftExtension());'; 
  1255. echo '} 
  1256. </script>'; 
  1257.  
  1258.  
  1259.  
  1260. /** 
  1261. * function to use get buddypress page id 
  1262. * 
  1263. *  
  1264. */ 
  1265.  
  1266. function evolve_bp_get_id() { 
  1267. $post_id = ''; 
  1268. $bp_page_id = get_option('bp-pages'); 
  1269.  
  1270. if (is_buddypress()) { 
  1271. if (bp_is_current_component('members')) { 
  1272. $post_id = $bp_page_id['members']; 
  1273. } elseif (bp_is_current_component('activity')) { 
  1274. $post_id = $bp_page_id['activity']; 
  1275. } elseif (bp_is_current_component('groups')) { 
  1276. $post_id = $bp_page_id['groups']; 
  1277. } elseif (bp_is_current_component('register')) { 
  1278. $post_id = $bp_page_id['register']; 
  1279. } elseif (bp_is_current_component('activate')) { 
  1280. $post_id = $bp_page_id['activate']; 
  1281. } else { 
  1282. $post_id = ''; 
  1283.  
  1284. return $post_id; 
  1285.  
  1286. /** 
  1287. * function to print out css class according to layout or post meta 
  1288. * used in content-blog.php, index.php, buddypress.php, bbpress.php 
  1289. * @since 3.3.0 
  1290. * 
  1291. * added by Denzel 
  1292. */ 
  1293.  
  1294. function evolve_layout_class($type = 1) { 
  1295. //$type = 1 is for content-blog.php and index.php, which includes the get_post_meta($post->ID, 'evolve_full_width', true).. 
  1296. //$type = 2 is for buddypress.php and bbpress.php, which EXCLUDES the get_post_meta($post->ID, 'evolve_full_width', true)..  
  1297. global $post; 
  1298. global $wp_query; 
  1299. $evolve_layout = evolve_get_option('evl_layout', '2cl'); 
  1300. $evolve_post_layout = evolve_get_option('evl_post_layout', 'two'); 
  1301.  
  1302. $post_id = ''; 
  1303. if ($wp_query->is_posts_page) { 
  1304. $post_id = get_option('page_for_posts'); 
  1305. } elseif (is_buddypress()) { 
  1306. $post_id = evolve_bp_get_id(); 
  1307. } else { 
  1308. $post_id = isset($post->ID) ? $post->ID : ''; 
  1309.  
  1310. $layout_css = ''; 
  1311.  
  1312. if ($evolve_layout == "1c") { 
  1313. $layout_css.= ' col-md-12'; 
  1314. } else { 
  1315.  
  1316. $layout_css.= ' col-xs-12 col-sm-6'; 
  1317.  
  1318. if (($evolve_layout == "2cr" && ($evolve_post_layout == "two") || $evolve_layout == "2cl" && ($evolve_post_layout == "two"))) { 
  1319. $layout_css.= ' col-md-8'; 
  1320.  
  1321. if (($evolve_layout == "3cm" || $evolve_layout == "3cl" || $evolve_layout == "3cr")) { 
  1322. $layout_css.= ' col-md-6'; 
  1323. } else { 
  1324. $layout_css.= ' col-md-8'; 
  1325.  
  1326. if (is_single() || is_page() || is_404() || is_search()) { 
  1327. $layout_css.= ' col-single'; 
  1328.  
  1329. if ($type == 1) { 
  1330.  
  1331.  
  1332. if (class_exists('Woocommerce')): 
  1333. if (is_cart() || is_checkout() || is_account_page() || (get_option('woocommerce_thanks_page_id') && is_page(get_option('woocommerce_thanks_page_id')))) { 
  1334. $layout_css .= ' full-width'; 
  1335. endif; 
  1336.  
  1337. if (is_single() || is_page() || $wp_query->is_posts_page || is_buddypress() || is_bbpress()): 
  1338.  
  1339. $evolve_sidebar_position = get_post_meta($post_id, 'evolve_sidebar_position', true); 
  1340.  
  1341. if (($type == 1 && $evolve_sidebar_position == 'default') || ($type == 2 && $evolve_sidebar_position == 'default')) { 
  1342. if (get_post_meta($post_id, 'evolve_full_width', true) == 'yes') { 
  1343. $layout_css .= ' full-width'; 
  1344.  
  1345. if ($evolve_sidebar_position == '2cl') { 
  1346. $layout_css = 'col-xs-12 col-sm-6 col-md-8 col-md-8 float-left'; 
  1347.  
  1348. if ($evolve_sidebar_position == '2cr') { 
  1349. $layout_css = 'col-xs-12 col-sm-6 col-md-8 col-md-8 float-right'; 
  1350.  
  1351. if ($evolve_sidebar_position == "3cm") { 
  1352. $layout_css = 'col-xs-12 col-sm-6 col-md-6 float-left'; 
  1353.  
  1354. if ($evolve_sidebar_position == "3cr") { 
  1355. $layout_css = 'col-xs-12 col-sm-6 col-md-6 float-right'; 
  1356.  
  1357. if ($evolve_sidebar_position == "3cl") { 
  1358. $layout_css = 'col-xs-12 col-sm-6 col-md-6 float-left'; 
  1359.  
  1360. if (is_single() || is_page() || $wp_query->is_posts_page) { 
  1361. $layout_css.= ' col-single'; 
  1362.  
  1363. endif; 
  1364.  
  1365. echo $layout_css; 
  1366.  
  1367. /** 
  1368. * function to print out css class according to layout 
  1369. * used in content-blog.php, index.php. 
  1370. * 
  1371. * added by Denzel 
  1372. */ 
  1373.  
  1374. function evolve_post_class($xyz) { 
  1375.  
  1376. $evolve_post_layout = evolve_get_option('evl_post_layout', 'two'); 
  1377.  
  1378. if ($evolve_post_layout == "two") { 
  1379. echo ' col-md-6 odd' . ( $xyz % 2 ); 
  1380. } else { 
  1381. echo ' col-md-4 odd' . ( $xyz % 3 ); 
  1382.  
  1383. if (has_post_format(array( 
  1384. 'aside',  
  1385. 'audio',  
  1386. 'chat',  
  1387. 'gallery',  
  1388. 'image',  
  1389. 'link',  
  1390. 'quote',  
  1391. 'status',  
  1392. 'video' 
  1393. ), '')) { 
  1394. echo ' formatted-post'; 
  1395.  
  1396. /** 
  1397. * function to print out css class according to post format 
  1398. * used in content-blog.php, index.php. 
  1399. *  
  1400. * added by Denzel 
  1401. */ 
  1402.  
  1403. function evolve_post_class_2() { 
  1404. if (has_post_format(array( 
  1405. 'aside',  
  1406. 'audio',  
  1407. 'chat',  
  1408. 'gallery',  
  1409. 'image',  
  1410. 'link',  
  1411. 'quote',  
  1412. 'status',  
  1413. 'video' 
  1414. ), '') || is_sticky() 
  1415. ) { 
  1416. echo 'formatted-post formatted-single margin-40'; 
  1417.  
  1418. /** 
  1419. * function to print out css class according to layout 
  1420. * used in sidebar.php 
  1421. *  
  1422. * added by Denzel 
  1423. */ 
  1424.  
  1425. function evolve_sidebar_class() { 
  1426.  
  1427. global $wp_query; 
  1428. global $post; 
  1429. $post_id = ''; 
  1430. if ($wp_query->is_posts_page) { 
  1431. $post_id = get_option('page_for_posts'); 
  1432. } elseif (is_buddypress()) { 
  1433. $post_id = evolve_bp_get_id(); 
  1434. } else { 
  1435. $post_id = isset($post->ID) ? $post->ID : ''; 
  1436.  
  1437. $sidebar_css = ''; 
  1438.  
  1439. $evolve_layout = evolve_get_option('evl_layout', '2cl'); 
  1440.  
  1441. //use PHP switch statement, is easier to understand. 
  1442. switch ($evolve_layout): 
  1443. case "1c": 
  1444. //do nothing 
  1445. break; 
  1446. case "2cl": 
  1447. $sidebar_css = 'col-sm-6 col-md-4'; 
  1448. break; 
  1449. case "2cr": 
  1450. $sidebar_css = 'col-sm-6 col-md-4'; 
  1451. break; 
  1452. case "3cm": 
  1453. $sidebar_css = 'col-xs-12 col-sm-6 col-md-3'; 
  1454. break; 
  1455. case "3cl": 
  1456. $sidebar_css = 'col-xs-12 col-sm-6 col-md-3'; 
  1457. break; 
  1458. case "3cr": 
  1459. $sidebar_css = 'col-xs-12 col-sm-6 col-md-3'; 
  1460. break; 
  1461. endswitch; 
  1462.  
  1463. $evolve_sidebar_position = get_post_meta($post_id, 'evolve_sidebar_position', true); 
  1464.  
  1465. if(is_page() || is_single()): 
  1466. //use PHP switch statement, is easier to understand. 
  1467. switch ($evolve_sidebar_position): 
  1468. case "default": 
  1469. //do nothing 
  1470. break; 
  1471. case "2cl": 
  1472. $sidebar_css = 'col-sm-6 col-md-4'; 
  1473. break; 
  1474. case "2cr": 
  1475. $sidebar_css = 'col-sm-6 col-md-4'; 
  1476. break; 
  1477. case "3cm": 
  1478. $sidebar_css = 'col-xs-12 col-sm-6 col-md-3'; 
  1479. break; 
  1480. case "3cl": 
  1481. $sidebar_css = 'col-xs-12 col-sm-6 col-md-3 float-right'; 
  1482. break; 
  1483. case "3cr": 
  1484. $sidebar_css = 'col-xs-12 col-sm-6 col-md-3 float-left'; 
  1485. break; 
  1486. endswitch; 
  1487. endif; 
  1488.  
  1489.  
  1490. echo $sidebar_css; 
  1491.  
  1492. /** 
  1493. * function to determine whether to get_sidebar, depending on theme options layout and post meta layout. 
  1494. * used in 404.php, archive.php, attachment.php, author.php, bbpress.php, blog-page.php, ...  
  1495. * buddypress.php, index.php, page.php, search.php single.php 
  1496. *  
  1497. * @return boolean indicates whether to load sidebar. 
  1498. * added by Denzel 
  1499. */ 
  1500.  
  1501. function evolve_lets_get_sidebar() { 
  1502.  
  1503. global $wp_query, $post; 
  1504. $post_id = ''; 
  1505. if ($wp_query->is_posts_page) { 
  1506. $post_id = get_option('page_for_posts'); 
  1507. } elseif (is_buddypress()) { 
  1508. $post_id = evolve_bp_get_id(); 
  1509. } else { 
  1510. $post_id = isset($post->ID) ? $post->ID : ''; 
  1511.  
  1512. $get_sidebar = false; 
  1513.  
  1514. $evolve_layout = evolve_get_option('evl_layout', '2cl'); 
  1515.  
  1516. if ($evolve_layout != "1c") { 
  1517. $get_sidebar = true; 
  1518.  
  1519. if (( is_page() || is_single() || $wp_query->is_posts_page || is_buddypress() || is_bbpress()) && get_post_meta($post_id, 'evolve_full_width', true) == 'yes') { 
  1520. $get_sidebar = false; 
  1521.  
  1522. if (is_single() || is_page() || $wp_query->is_posts_page || is_buddypress() || is_bbpress()): 
  1523.  
  1524. $evolve_sidebar_position = get_post_meta($post_id, 'evolve_sidebar_position', true); 
  1525.  
  1526. if ($evolve_sidebar_position != 'default' && $evolve_sidebar_position != '') { 
  1527. $get_sidebar = true; 
  1528.  
  1529. endif; 
  1530.  
  1531. return $get_sidebar; 
  1532.  
  1533. /** 
  1534. * function to determine whether to get_sidebar('2'), depending on theme options layout and post meta layout. 
  1535. * used in 404.php, archive.php, attachment.php, author.php, bbpress.php, blog-page.php, ...  
  1536. * buddypress.php, index.php, page.php, search.php single.php 
  1537. *  
  1538. * @return boolean indicates whether to load sidebar. 
  1539. * added by Denzel 
  1540. */ 
  1541.  
  1542. function evolve_lets_get_sidebar_2() { 
  1543.  
  1544. global $wp_query, $post; 
  1545. $post_id = ''; 
  1546. if ($wp_query->is_posts_page) { 
  1547. $post_id = get_option('page_for_posts'); 
  1548. } elseif (is_buddypress()) { 
  1549. $post_id = evolve_bp_get_id(); 
  1550. } else { 
  1551. $post_id = isset($post->ID) ? $post->ID : ''; 
  1552.  
  1553. $get_sidebar = false; 
  1554.  
  1555. $evolve_layout = evolve_get_option('evl_layout', '2cl'); 
  1556.  
  1557. if ($evolve_layout == "3cm" || $evolve_layout == "3cl" || $evolve_layout == "3cr") { 
  1558. $get_sidebar = true; 
  1559.  
  1560. if (( is_page() || is_single() || $wp_query->is_posts_page || is_buddypress() || is_bbpress()) && get_post_meta($post_id, 'evolve_full_width', true) == 'yes') { 
  1561. $get_sidebar = false; 
  1562.  
  1563. if (is_single() || is_page() || $wp_query->is_posts_page || is_buddypress() || is_bbpress()): 
  1564.  
  1565. $evolve_sidebar_position = get_post_meta($post_id, 'evolve_sidebar_position', true); 
  1566.  
  1567. if ($evolve_sidebar_position == '2cl' || $evolve_sidebar_position == '2cr') { 
  1568. $get_sidebar = false; 
  1569.  
  1570. if ($evolve_sidebar_position == "3cm" || $evolve_sidebar_position == "3cl" || $evolve_sidebar_position == "3cr") { 
  1571. $get_sidebar = true; 
  1572.  
  1573. endif; 
  1574.  
  1575. return $get_sidebar; 
  1576.  
  1577. function evolve_print_fonts($name, $css_class, $additional_css = '', $additional_color_css_class = '', $imp = '') { 
  1578. global $evl_options; 
  1579. $options = $evl_options; 
  1580. $css = ''; 
  1581. $font_size = ''; 
  1582. $font_family = ''; 
  1583. $font_style = ''; 
  1584. $font_weight = ''; 
  1585. $color = ''; 
  1586. if ($options[$name]['font-size'] != '') { 
  1587. $font_size = $options[$name]['font-size']; 
  1588. $css .= "$css_class{font-size:" . $font_size . " " . $imp . ";}"; 
  1589. if ($options[$name]['font-family'] != '') { 
  1590. $font_family = $options[$name]['font-family']; 
  1591. $css .= "$css_class{font-family:" . $font_family . ";}"; 
  1592. if (isset($options[$name]['font-style']) && $options[$name]['font-style'] != '') { 
  1593. $font_style = $options[$name]['font-style']; 
  1594. $css .= "$css_class{font-style:" . $font_style . ";}"; 
  1595. if (isset($options[$name]['font-weight']) && $options[$name]['font-weight'] != '') { 
  1596. $font_weight = $options[$name]['font-weight']; 
  1597. $css .= "$css_class{font-weight:" . $font_weight . ";}"; 
  1598. if (isset($options[$name]['color']) && $options[$name]['color'] != '') { 
  1599. $color = $options[$name]['color']; 
  1600. $css .= "$css_class{color:" . $color . ";}"; 
  1601. if ($additional_css != '') { 
  1602. $css .= "$css_class{" . $additional_css . ";}"; 
  1603. if ($additional_color_css_class != '') { 
  1604. $color = $options[$name]['color']; 
  1605. $css .= "$additional_color_css_class{color:" . $color . ";}"; 
  1606.  
  1607. return $css; 
  1608.  
  1609. if (!function_exists('evolve_custom_number_paging_nav')) : 
  1610.  
  1611. function evolve_custom_number_paging_nav() { 
  1612. // Don't print empty markup if there's only one page. 
  1613. if ($GLOBALS['wp_query']->max_num_pages < 2) { 
  1614. return; 
  1615.  
  1616. $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1; 
  1617. $pagenum_link = html_entity_decode(get_pagenum_link()); 
  1618. $query_args = array(); 
  1619. $url_parts = explode('?', $pagenum_link); 
  1620.  
  1621. if (isset($url_parts[1])) { 
  1622. wp_parse_str($url_parts[1], $query_args); 
  1623.  
  1624. $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link); 
  1625. $pagenum_link = trailingslashit($pagenum_link) . '%_%'; 
  1626.  
  1627. $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : ''; 
  1628. $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%'; 
  1629.  
  1630. // Set up paginated links. 
  1631. $links = paginate_links(array( 
  1632. 'base' => $pagenum_link,  
  1633. 'format' => $format,  
  1634. 'total' => $GLOBALS['wp_query']->max_num_pages,  
  1635. 'current' => $paged,  
  1636. 'mid_size' => 3,  
  1637. 'add_args' => array_map('urlencode', $query_args),  
  1638. 'prev_text' => sprintf('<span class="t4p-icon-chevron-left"></span> %s', __('Previous ', 'evolve')),  
  1639. 'next_text' => sprintf('%s <span class="t4p-icon-chevron-right"></span>', __('Next ', 'evolve')),  
  1640. 'type' => 'list',  
  1641. )); 
  1642.  
  1643. if ($links) : 
  1644.  
  1645. echo $links; 
  1646.  
  1647. endif; 
  1648.  
  1649. endif; 
  1650.  
  1651. /** change in bbpress breadcrumb */ 
  1652.  
  1653. function evolve_custom_bbp_breadcrumb() { 
  1654. $args['sep'] = ' / '; 
  1655. return $args; 
  1656.  
  1657. add_filter('bbp_before_get_breadcrumb_parse_args', 'evolve_custom_bbp_breadcrumb'); 
  1658.  
  1659. /** Change prefix pyre to evolve */ 
  1660.  
  1661. $evolve_change_metabox_prefix = get_option('evl_change_metabox_prefix', 0); 
  1662. if ($evolve_change_metabox_prefix != 1) { 
  1663. add_action('admin_init', 'evolve_change_prefix'); 
  1664. update_option('evl_change_metabox_prefix', 1); 
  1665.  
  1666. function evolve_change_prefix() { 
  1667. global $wpdb; 
  1668.  
  1669. $querystr = " SELECT meta_key FROM $wpdb->postmeta WHERE `meta_key` LIKE '%pyre_%' "; 
  1670.  
  1671. $evolve_meta_key = $wpdb->get_results($querystr); 
  1672. foreach ($evolve_meta_key as $meta_key) { 
  1673. $original_meta_key = $meta_key->meta_key; 
  1674.  
  1675. $change_meta_key = str_replace("pyre_", "evolve_", $original_meta_key); 
  1676.  
  1677. $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = REPLACE(meta_key, '$original_meta_key', '$change_meta_key')"); 
  1678.  
  1679. //filter added for buddypress-docs comment show 
  1680. add_filter( 'bp_docs_allow_comment_section', '__return_true', 100 ); 
.