Title: Child theme functions bug
Last modified: August 21, 2016

---

# Child theme functions bug

 *  [bozonja](https://wordpress.org/support/users/bozonja/)
 * (@bozonja)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-functions-bug/)
 * Hi there! When I put anything in functions file in child theme and save changes
   my site collapses!? Bug oor?! I am using 2.1.2. version of theme.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-functions-bug/#post-4740800)
 * Not sure what you mean by “anything”, what exactly are you trying?
 *  Thread Starter [bozonja](https://wordpress.org/support/users/bozonja/)
 * (@bozonja)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-functions-bug/#post-4740801)
 * Any random code that I want to change and put in functions.php in child theme.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-functions-bug/#post-4740803)
 * You can’t put random code into functions.php, it’s PHP and you have to use PHP
   syntax. There are other reasons why it could break, but we’d need to see the 
   code you’re using.
 *  Thread Starter [bozonja](https://wordpress.org/support/users/bozonja/)
 * (@bozonja)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-functions-bug/#post-4740805)
 * **I have putted this:**
 *  `<script type=”text/javascript”>
    // Check if first slider image is loaded, 
   and load flexslider on document ready jQuery(document).ready(function(){ var 
   firstImage = jQuery(‘#flexslider-featured’).find(‘img’).filter(‘:first’), checkforloaded
   = setInterval(function() { var image = firstImage.get(0); if (image.complete 
   || image.readyState == ‘complete’ || image.readyState == 4) { clearInterval(checkforloaded);
 *  jQuery(‘#flexslider-featured’).flexslider({
    animation: “slide”, useCSS: false,//
   Fix iPad flickering issue slideshow: true, directionNav: true, controlNav: true,
   pauseOnHover: true, slideshowSpeed: 4000, animationSpeed: 400, smoothHeight: 
   true, touch: false });
 *  }
    }, 20); }); </script>`
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-functions-bug/#post-4740806)
 * Yeah that’s JavaScript and not PHP, so that will break your site.
 *  Thread Starter [bozonja](https://wordpress.org/support/users/bozonja/)
 * (@bozonja)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-functions-bug/#post-4740807)
 * So this can´t go in functions.php in child theme? How can I edit this in child
   theme? I must create another stylesheet and put it in child theme folder oor?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-functions-bug/#post-4740808)
 * Try putting your JavaScript into a ‘.js’ file, just this bit:
 *     ```
       // Check if first slider image is loaded, and load flexslider on document ready
       jQuery(document).ready(function(){
       var firstImage = jQuery('#flexslider-featured').find('img').filter(':first'),
       checkforloaded = setInterval(function() {
       var image = firstImage.get(0);
       if (image.complete || image.readyState == 'complete' || image.readyState == 4) {
       clearInterval(checkforloaded);
   
       jQuery('#flexslider-featured').flexslider({
       animation: "slide",
       useCSS: false, // Fix iPad flickering issue
       slideshow: true,
       directionNav: true,
       controlNav: true,
       pauseOnHover: true,
       slideshowSpeed: 4000,
       animationSpeed: 400,
       smoothHeight: true,
       touch: false
       });
   
       }
       }, 20);
       });
       ```
   
 * And then enqueue that ‘.js’ file through your Child Theme functions.php file:
   [http://codex.wordpress.org/Function_Reference/wp_enqueue_script](http://codex.wordpress.org/Function_Reference/wp_enqueue_script)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Child theme functions bug’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/hueman/3.7.27/screenshot.png)
 * Hueman
 * [Support Threads](https://wordpress.org/support/theme/hueman/)
 * [Active Topics](https://wordpress.org/support/theme/hueman/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/hueman/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/hueman/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-functions-bug/#post-4740808)
 * Status: not resolved