skt_photo_world_custom_head_codes

The SKT Photo World skt photo world custom head codes function.

Description

skt_photo_world_custom_head_codes(); 

Usage

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

Defined (1)

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

/functions.php  
  1. function skt_photo_world_custom_head_codes() { 
  2. if ( (function_exists( 'of_get_option' )) && (of_get_option('headcode1', true) != 1) ) { 
  3. echo esc_html( of_get_option('headcode1', true) ); 
  4. if ( (function_exists( 'of_get_option' )) && (of_get_option('style2', true) != 1) ) { 
  5. echo "<style>". esc_html( of_get_option('style2', true) ) ."</style>"; 
  6. //Modify CSS a little if Slider is disabled.  
  7. if ( ( of_get_option('slider_enabled') == 0 ) || ( (is_home() == false) ) ) { 
  8. echo "<style>.main-navigation { margin-bottom: -5px;}</style>"; 
  9. if ( ( of_get_option('slider_enabled') == 0 ) || ( (is_front_page() == true) ) ) { 
  10. echo "<style>.main-navigation { margin-bottom: 15px;}</style>"; 
  11. if ( function_exists( 'of_get_option' ) ) { 
  12. echo "<style>"; 
  13. if( of_get_option('navigation_icon', true) != '' ) { 
  14. echo "#site-nav ul li a:hover, #site-nav li.current_page_item a{background-image:url(".of_get_option('navigation_icon', true).")}"; 
  15. if( of_get_option('navigation_color', true) != '' ) { 
  16. echo "#site-nav ul li a:hover, #site-nav li.current_page_item a, div.slide-title a:hover, a, .entry-meta a, .widget ul li a:hover, .footer-menu ul li a:hover, .social a:hover, .footer-bottom a, h2.entry-title a:hover{color:".of_get_option('navigation_color', true).";}mark, ins, a, .entry-meta a, .read-more a:hover, .recent-post .post-box .post-text a, aside ul li a:hover, .widget ul li a:hover, .footer-menu ul li a:hover, .social a:hover, .footer-bottom a, {color:".of_get_option('navigation_color', true).";}button, html input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"]{background-color:".of_get_option('navigation_color', true).";}"; 
  17. if( (of_get_option('pagin_grad_top_color', true) != '') && (of_get_option('pagin_grad_bottom_color', true) != '') ) { 
  18. echo ".pagination ul > li > a, .pagination ul > li > span{background:linear-gradient(".of_get_option('pagin_grad_top_color', true).", ".of_get_option('pagin_grad_bottom_color', true).") !important; background:-moz-linear-gradient(".of_get_option('pagin_grad_top_color', true).", ".of_get_option('pagin_grad_bottom_color', true).") !important; background:-webkit-linear-gradient(".of_get_option('pagin_grad_top_color', true).", ".of_get_option('pagin_grad_bottom_color', true).") !important; background:-o-linear-gradient(".of_get_option('pagin_grad_top_color', true).", ".of_get_option('pagin_grad_bottom_color', true).") !important;}.pagination ul > li:hover > a, .pagination ul > li > span.current{background:linear-gradient(".of_get_option('pagin_grad_bottom_color', true).", ".of_get_option('pagin_grad_top_color', true).") !important; background:-moz-linear-gradient(".of_get_option('pagin_grad_bottom_color', true).", ".of_get_option('pagin_grad_top_color', true).") !important; background:-webkit-linear-gradient(".of_get_option('pagin_grad_bottom_color', true).", ".of_get_option('pagin_grad_top_color', true).") !important; background:-o-linear-gradient(".of_get_option('pagin_grad_bottom_color', true).", ".of_get_option('pagin_grad_top_color', true).") !important;}"; 
  19. echo "</style>"; 
  20. }  
  21.  
  22.  
  23. ?><script type="text/javascript"> 
  24. jQuery(document).ready(function() { 
  25. jQuery.supersized({ 
  26. // Functionality 
  27. slideshow : 1, // Slideshow on/off 
  28. autoplay : 1, // Determines whether slideshow begins playing when page is loaded.  
  29. start_slide : 1, // Start slide (0 is random) 
  30. stop_loop : 0, // Pauses slideshow on last slide 
  31. random : 0, // Randomize slide order (Ignores start slide) 
  32. slide_interval : 5000, // Length between transitions 
  33. transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left 
  34. transition_speed : 1000, // Speed of transition 
  35. new_window : 1, // Image links open in new window/tab 
  36. pause_hover : 0, // Pause slideshow on hover 
  37. keyboard_nav : 1, // Keyboard navigation on/off 
  38. performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit) 
  39. image_protect : 0, // Disables image dragging and right click with Javascript 
  40.  
  41. // Size & Position 
  42. min_width : 0, // Min width allowed (in pixels) 
  43. min_height : 0, // Min height allowed (in pixels) 
  44. vertical_center : 1, // Vertically center background 
  45. horizontal_center : 1, // Horizontally center background 
  46. fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions) 
  47. fit_portrait : 1, // Portrait images will not exceed browser height 
  48. fit_landscape : 0, // Landscape images will not exceed browser width 
  49.  
  50. // Components  
  51. slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank') 
  52. thumb_links : 1, // Individual thumb links for each slide 
  53. thumbnail_navigation : 0, // Thumbnail navigation 
  54. slides : [ // Slideshow Images 
  55. <?php 
  56. if( is_front_page() || is_home() ) { 
  57. for ($i=1;$i<10;$i++) { 
  58. if ( of_get_option('slide'.$i, true) != "" ) { 
  59. $imgUrl = esc_url( of_get_option('slide'.$i, true) ); 
  60. $imgTitle = esc_html( of_get_option('slidetitle'.$i, true) ); 
  61. $imgDesc = esc_html( of_get_option('slidedesc'.$i, true) ); 
  62. $imgHref = esc_html( of_get_option('slideurl'.$i, true) ); 
  63. if( $imgUrl != '' ) { 
  64. echo '{image : \''.$imgUrl.'\', title : \'<div class="slide-title"><span>'.( ($imgHref!='' && $imgTitle!='') ? '<a href="'.$imgHref.'">' : '').$imgTitle.( ($imgHref!='' && $imgTitle!='') ? '</a>' : '').'</span></div><div class="slide-description"><span>'.$imgDesc.'</span></div>'.( ($imgHref != '') ? '<div class="slide-description"><span><a href="'.$imgHref.'">Read More ›</a></span></div>' : '').'\', thumb : \''.$imgUrl.'\', url : \'\'}, '."\n"; 
  65. }else{ 
  66. $featured_as_background = esc_html( of_get_option('featured_as_background', true) ); 
  67. if( $featured_as_background != 1 && has_post_thumbnail() ) { 
  68. $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); 
  69. $imgUrl = $large_image_url[0]; 
  70. echo '{image : \''.$imgUrl.'\', title : \'\', thumb : \''.$imgUrl.'\', url : \'\'}, '."\n"; 
  71. }else{ 
  72. $page_bg_image_url = get_background_image(); 
  73. echo '{image : \''.$page_bg_image_url.'\', title : \'\', thumb : \''.$page_bg_image_url.'\', url : \'\'}, '."\n"; 
  74. ?> 
  75. ],  
  76. // Theme Options  
  77. progress_bar : 1, // Timer for each slide  
  78. mouse_scrub : 0 
  79. }); 
  80.  
  81. // hide controller if only 1 image exist. 
  82. var cntSlide = jQuery('ul#thumb-list li').length; 
  83. if( cntSlide < 2 ) { 
  84. jQuery('#controls-wrapper').css('visibility', 'hidden'); 
  85. }); 
  86.  
  87. </script><?php 
  88.  
  89. }