Advertisement
xpeed

js hook

Jun 18th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1.    function xs_hook_js() {
  2.         $slideshow = '';
  3.         $slides = xs_get_option('theme_options', 'main_slider');
  4.  
  5.         if (is_array($slides)) {
  6.             foreach ($slides as $arr) {
  7.                 $slideshow .= "'" . $arr['img_src'] . "',";
  8.             }
  9.         }
  10.         trim($slideshow, ",");
  11.         $output = "
  12. /* ================================  BACKGROUND SLIDESHOW  =================================== */
  13. jQuery(document).ready(function($) {
  14. $.backstretch([
  15.  
  16.  // you can additional images in here with comma separated values
  17. " . $slideshow . "
  18.  
  19.  ], {
  20.  fade: " . xs_get_option('theme_options', 'fading_speed') . ",
  21.  duration: " . xs_get_option('theme_options', 'animation_pause') . "
  22. });  
  23.  
  24. });";
  25.  
  26.         echo "<script>$output</script>";
  27.     }
  28.  
  29.     add_action('wp_footer', 'xs_hook_js', 99);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement