Title: WordPress / jQuery
Last modified: August 20, 2016

---

# WordPress / jQuery

 *  [Frank1100](https://wordpress.org/support/users/frank1100/)
 * (@frank1100)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/)
 * I’m following to insert this fold-open jQuery effect to some posts
    [http://www.sohtanaka.com/web-design/examples/toggle/](http://www.sohtanaka.com/web-design/examples/toggle/)
   here is the step by step procedure of it [http://www.sohtanaka.com/web-design/easy-toggle-jquery-tutorial/](http://www.sohtanaka.com/web-design/easy-toggle-jquery-tutorial/)
   I understand step 1, but it doesn’t say where to paste the function code in step
   2 … in the post ior header.php it just creates corresponding text.
 * Who knows how this works correctly ?
 * Thx,
    Frank

Viewing 15 replies - 16 through 30 (of 33 total)

[←](https://wordpress.org/support/topic/wordpress-jquery/?output_format=md) [1](https://wordpress.org/support/topic/wordpress-jquery/?output_format=md)
2 [3](https://wordpress.org/support/topic/wordpress-jquery/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/wordpress-jquery/page/3/?output_format=md)

 *  Thread Starter [Frank1100](https://wordpress.org/support/users/frank1100/)
 * (@frank1100)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363941)
 * **My CSS: (edited)**
 * h2.trigger a {
    display: block; text-decoration: none; }
 *  Thread Starter [Frank1100](https://wordpress.org/support/users/frank1100/)
 * (@frank1100)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363942)
 * when I click the toggle link, it justs jums to the top of the page
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363943)
 * toggle.js is not loaded. Did you put toggle.js in a directory “js” inside your
   theme folder?
 *  Thread Starter [Frank1100](https://wordpress.org/support/users/frank1100/)
 * (@frank1100)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363945)
 * yes, is under wp-content/themes/mystique/js/toggle.js … other .js files are there
   as well [http://img827.imageshack.us/img827/6540/capturehei.png](http://img827.imageshack.us/img827/6540/capturehei.png)
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363946)
 * Try changing the code in your theme’s functions.php to:
 *     ```
       function my_scripts_method() {
          // register your script location, dependencies and version
          wp_register_script('toggle_script',
              get_template_directory_uri() . '/js/toggle.js',
              array('jquery'), null);
          // enqueue the script
          wp_enqueue_script('toggle_script');
        }
         add_action('wp_enqueue_scripts', 'my_scripts_method');
       ```
   
 *  Thread Starter [Frank1100](https://wordpress.org/support/users/frank1100/)
 * (@frank1100)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363948)
 * tx ! … did, but still just jumping to top
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363949)
 * > did, but still just jumping to top
 * That’s because toggle.js is still not loaded.
 * try:
 * – deactivating **all** plugins to see if this resolves the problem? If this works,
   re-activate the plugins one by one until you find the problematic plugin(s).
 *  Thread Starter [Frank1100](https://wordpress.org/support/users/frank1100/)
 * (@frank1100)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363950)
 * all deactivated now, but toggle.js still not loading yet
 *  Thread Starter [Frank1100](https://wordpress.org/support/users/frank1100/)
 * (@frank1100)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363951)
 * I noticed that the test pages function.php is left open at the end … no closing
   bracket, seems to be wordpress practice (joomla has it too this way I think) …
 * and my [final-function.php](http://bin.cakephp.org/view/213840077) is closed …
   maybe the reason for this ?
 * Tried to leave the closing bracket away but then I get a page error on this website/
   but not on the other …
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363952)
 * I’m stumped, on my testsite this works.
 * Are you using a [child theme](http://codex.wordpress.org/Child_Themes)?
    what
   is the full error when you leave the closing bracket?
 *  Thread Starter [Frank1100](https://wordpress.org/support/users/frank1100/)
 * (@frank1100)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363953)
 * no child theme, not that I know
 * error gives me :
 * Parse error: syntax error, unexpected $end in /xxxx/yyyy/zzzz/uptoconcept/current01.
   uptoconcept.com/wordpress/wp-content/themes/mystique/functions.php on line 228
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363954)
 * Try putting a closing bracket “}” to the function mystique_remove_old_version_options
   in your functions.php like this:
 *     ```
       function mystique_remove_old_version_options($old_version){
         if(version_compare($old_version, '3.0', '<')) Atom::app()->reset();
       }
       ```
   
 *  Thread Starter [Frank1100](https://wordpress.org/support/users/frank1100/)
 * (@frank1100)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363955)
 * I pasted your code at the end before the closing bracket of my [function.php](http://bin.cakephp.org/view/2059667441)
   but still not working
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363956)
 * try it with this functions.php: [http://bin.cakephp.org/pastes/edit/70434](http://bin.cakephp.org/pastes/edit/70434)
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/2/#post-2363957)
 * That doesn’t work. try it with this functions.php: [http://pastebin.com/qjrrbuzr](http://pastebin.com/qjrrbuzr)

Viewing 15 replies - 16 through 30 (of 33 total)

[←](https://wordpress.org/support/topic/wordpress-jquery/?output_format=md) [1](https://wordpress.org/support/topic/wordpress-jquery/?output_format=md)
2 [3](https://wordpress.org/support/topic/wordpress-jquery/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/wordpress-jquery/page/3/?output_format=md)

The topic ‘WordPress / jQuery’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 33 replies
 * 2 participants
 * Last reply from: [Frank1100](https://wordpress.org/support/users/frank1100/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/wordpress-jquery/page/3/#post-2363960)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
