Title: code for adding Jquery plugin
Last modified: August 20, 2016

---

# code for adding Jquery plugin

 *  [groenhans](https://wordpress.org/support/users/groenhans/)
 * (@groenhans)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/code-for-adding-jquery-plugin/)
 * Hi all,
 * I’ve been trying to get a query plugin to work on my WordPress site. It’s not
   though and I’m hoping someone could tell me what I’m doing wrong…
    I went about
   as following:
 * First I put the files
 * **curtain.js
    curtain.css scripts.js
 * in a js folder, which I put in my theme folder. I am using a **child theme**!
 * I then put the following code in the functions.php of my child theme.
 * **function my_scripts_method() {
    if (!is_admin()) { wp_register_script( ‘curtain’,
   get_stylesheet_directory_uri() . ‘/js/curtain.js’, array( ‘jquery’ ) ); wp_register_script(‘
   scripts’, get_stylesheet_directory_uri() . ‘/js/scripts.js’, array( ‘jquery’ ));
   wp_enqueue_script(‘curtain’); wp_enqueue_script(‘scripts’); wp_enqueue_script(‘
   jquery’); }
 * add_action(‘wp_enqueue_scripts’, ‘my_scripts_method’);
 * ..then this code in the scripts.js:
 * **$(document).ready(function(){
    $(‘.curtains’).curtain();  });
 * I now just see the actual code on my front page and I get the following message(
   amongst others):
 * Warning: Cannot modify header information – headers already sent by (output started
   at /data/home/stat01/domains/statesofgrace.nl/public_html/wp-content/themes/weaver-
   ii-child-demo/functions.php:4) in /data/home/stat01/domains/statesofgrace.nl/
   public_html/wp-login.php on line 368
 * What’s going wrong here??
 * Thanks in advance…
 * Hans

Viewing 1 replies (of 1 total)

 *  [mantismamita](https://wordpress.org/support/users/mantismamita/)
 * (@mantismamita)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/code-for-adding-jquery-plugin/#post-3379782)
 * Its probably because WordPress does not accept the dollar sign. The plugin needs
   to be adapted.

Viewing 1 replies (of 1 total)

The topic ‘code for adding Jquery plugin’ is closed to new replies.

## Tags

 * [enqueue](https://wordpress.org/support/topic-tag/enqueue/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [register](https://wordpress.org/support/topic-tag/register/)

 * 1 reply
 * 2 participants
 * Last reply from: [mantismamita](https://wordpress.org/support/users/mantismamita/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/code-for-adding-jquery-plugin/#post-3379782)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
