Title: functions.php file edit goes wrong
Last modified: September 5, 2020

---

# functions.php file edit goes wrong

 *  [kalanhd](https://wordpress.org/support/users/kalanhd/)
 * (@kalanhd)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/functions-php-file-edit-goes-wrong/)
 * Hey,I’m not sure if it the right place but I’m installing manually template and
   I run into troubles with the footer.php and the functions.php configuration…
 * I try to add js commands
 * Footer – This command.
    `<?php wp_footer();?>`
 * functions – This commands.
 *     ```
       function addjs()
       {
           wp_register_script('jquery' , get_template_directory_uri() . /assets/js/jquery-2.1.0.min.js , array()  , 1,1,1);
       wp_enqueue_script('jquery');
   
       wp_register_script('popper' , get_template_directory_uri() . /assets/js/popper.js , array() , 1,1,1);
       wp_enqueue_script('popper');
   
       wp_register_script('bootstrap' , get_template_directory_uri() . /assets/js/bootstrap.min.js , array() , 1,1,1);
       wp_enqueue_script('bootstrap');
   
       wp_register_script('scrollreveal' , get_template_directory_uri() . /assets/js/scrollreveal.min.js , array() , 1,1,1);
       wp_enqueue_script('scrollreveal');
   
       wp_register_script('waypoints' , get_template_directory_uri() . /assets/js/waypoints.min.js , array() , 1,1,1);
       wp_enqueue_script('waypoints');
   
       wp_register_script('counterup' , get_template_directory_uri() . /assets/js/jquery.counterup.min.js , array() , 1,1,1);
       wp_enqueue_script('counterup');
   
       wp_register_script('imgfix' , get_template_directory_uri() . /assets/js/imgfix.min.js , array() , 1,1,1);
       wp_enqueue_script('imgfix');
   
       wp_register_script('custom' , get_template_directory_uri() . /assets/js/custom.js , array() , 1,1,1);
       wp_enqueue_script('custom');
       }
   
       add_action('wp_enqueue_scripts', 'addjs');
       ```
   
 * In this situation i’ve this error – “There has been a critical error on your 
   website.”
 * If i delete this functions everything back to normal

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

 *  [Ian Sackofwits](https://wordpress.org/support/users/plantprogrammer/)
 * (@plantprogrammer)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/functions-php-file-edit-goes-wrong/#post-13366533)
 * Hi, kalanhd , I think the issue is that the number of parameters differs from
   what the developer page specifies- [https://developer.wordpress.org/reference/functions/wp_register_script/](https://developer.wordpress.org/reference/functions/wp_register_script/)
 * You have an extra argument sent to the function.
 *  [AddWeb Solution](https://wordpress.org/support/users/addweb-solution-pvt-ltd/)
 * (@addweb-solution-pvt-ltd)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/functions-php-file-edit-goes-wrong/#post-13380993)
 * Hey [@kalanhd](https://wordpress.org/support/users/kalanhd/)
 * I think there are 2 things you can change in your code
    The single quote is missing
   in the static path More arguments passed used in the function.
 * This is your code
 *     ```
       wp_register_script('jquery' , get_template_directory_uri() ./assets/js/jquery-2.1.0.min.js , array()  , 1,1,1);
       wp_enqueue_script('jquery');
       ```
   
 * please change the code something like this:
 *     ```
       wp_register_script('myfirstscript',get_template_directory_uri() .'/myscript.js', array(),false, false);
       wp_enqueue_script('myfirstscript');
       ```
   
 * For More detail please check this URL: [https://developer.wordpress.org/reference/functions/wp_register_script/](https://developer.wordpress.org/reference/functions/wp_register_script/)
 * Regards,
    -  This reply was modified 5 years, 9 months ago by [AddWeb Solution](https://wordpress.org/support/users/addweb-solution-pvt-ltd/).

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

The topic ‘functions.php file edit goes wrong’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 3 participants
 * Last reply from: [AddWeb Solution](https://wordpress.org/support/users/addweb-solution-pvt-ltd/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/functions-php-file-edit-goes-wrong/#post-13380993)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
