skt_parallaxme_custom_head_codes

The SKT Parallaxme skt parallaxme custom head codes function.

Description

skt_parallaxme_custom_head_codes(); 

Usage

  1. if ( !function_exists( 'skt_parallaxme_custom_head_codes' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = skt_parallaxme_custom_head_codes(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function skt_parallaxme_custom_head_codes() {  
  2. if ( (function_exists( 'of_get_option' )) && (of_get_option('style2', true) != 1) ) { 
  3. echo "<style>". esc_html( of_get_option('style2', true) ) ."</style>"; 
  4.  
  5. if ( (of_get_option('innerpageslider', true) != 'hide') || is_home() || is_front_page() ) { 
  6.  
  7. $slAr = array(); 
  8. for ($i=1; $i<6; $i++) { 
  9. if ( of_get_option('slide'.$i, true) ) { 
  10. $imgUrl = of_get_option('slide'.$i, true); 
  11. $imgTitle = ( of_get_option('slidetitle'.$i, true) != '') ? of_get_option('slidetitle'.$i, true) : 'aaaaa'; 
  12. if ( strlen($imgUrl) > 3 ) $slAr[$i] = of_get_option('slide'.$i, true); 
  13. ?> 
  14. <script type="text/javascript"> 
  15. jQuery(document).ready(function() { 
  16. jQuery.supersized({ 
  17. // Functionality 
  18. slideshow : 1, // Slideshow on/off 
  19. autoplay : 1, // Determines whether slideshow begins playing when page is loaded.  
  20. start_slide : 1, // Start slide (0 is random) 
  21. stop_loop : 0, // Pauses slideshow on last slide 
  22. random : 0, // Randomize slide order (Ignores start slide) 
  23. slide_interval : 5000, // Length between transitions 
  24. transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left 
  25. transition_speed : 1000, // Speed of transition 
  26. new_window : 1, // Image links open in new window/tab 
  27. pause_hover : 0, // Pause slideshow on hover 
  28. keyboard_nav : 1, // Keyboard navigation on/off 
  29. performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit) 
  30. image_protect : 0, // Disables image dragging and right click with Javascript 
  31.  
  32. // Size & Position 
  33. min_width : 0, // Min width allowed (in pixels) 
  34. min_height : 0, // Min height allowed (in pixels) 
  35. vertical_center : 1, // Vertically center background 
  36. horizontal_center : 1, // Horizontally center background 
  37. fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions) 
  38. fit_portrait : 1, // Portrait images will not exceed browser height 
  39. fit_landscape : 0, // Landscape images will not exceed browser width 
  40.  
  41. // Components  
  42. slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank') 
  43. thumb_links : 1, // Individual thumb links for each slide 
  44. thumbnail_navigation : 0, // Thumbnail navigation 
  45. slides : [ // Slideshow Images 
  46. <?php 
  47. $n = 0; 
  48. foreach( $slAr as $sk => $sv ) { 
  49. $n++; 
  50. echo "{image : '".$sv."', title : '<h1>".esc_attr(of_get_option('slidetitle'.$sk, true))."</h1>', thumb : '".$sv."', url : ''}".( (count($slAr) == $n) ? '' : ', ' )."\n"; 
  51. ?> 
  52. ],  
  53. // Theme Options  
  54. progress_bar : 1, // Timer for each slide  
  55. mouse_scrub : 0 
  56. }); 
  57. }); 
  58.  
  59. </script><?php  
  60.  
  61. }