Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This morning I updated my wp, and after that few of the jquery of my site is not working.

I am using woo themes premium newspaper theme.

After the upgrade, the categories drop down menu(superfish menu) stopped working. I was using lightbox plugin for images, that stopped working.

I deactivated all plugins and checked the theme, but still the superfish was not working, I updated the themes framework with latest, but still no effect.

Can any one help me in this?

My website URL is:http://webstutorial.com/ and the theme which I am using is this:http://demo.woothemes.com/?name=premiumnews

share|improve this question
1  
jquery was updated from 1.4.4 to 1.6.1. This was announced on the dev blog back in May: wpdevel.wordpress.com/2011/05/25/… You may want to ask the woothemes people for an upgrade. –  Otto Jul 5 '11 at 18:21
    
i have the same theme and same problem. :( have you solved yours yet? –  user6774 Jul 6 '11 at 0:03
    
I'm having the same issue. You have to have membership in order to post to their forums. I'm wondering if this is something they plan to send out and fix... I'm considering changing my theme all together into something that may work... which will kind of suck, but will be necessary. If anyone can figure it out. My categories don't drop down anymore either. –  user6776 Jul 6 '11 at 2:07
add comment

6 Answers

up vote 2 down vote accepted

The problem is with the theme. On the theme demo the superfish drop downs are not working and for some reason the theme is loading jquery 2 times version 1.3.1 from the theme directory and version 1.6.1 from the WordPress includes directory.

Your site is actually loading jquery 3 times.

I would contact the theme support.

share|improve this answer
    
you are right they are the only actual people who can solve this, I mailed them, they are looking into it –  ntechi Jul 6 '11 at 5:40
add comment

Going into the header.php file and reversing the order of the following lines made the dropdowns work on my sites, so I guess that's good enough for now. It still breaks my Featured Content Gallery plugin, but I'll figure that out later.

Reverse these:

<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/includes/js/jquery-1.3.2.min.js"></script>

<?php wp_head(); ?>

So that the wp_head code comes first.

EDIT

The proper place to enqueue scripts is in functions.php, rather than directly in the document head.

For example:

function my-theme_enqueue_scripts() {
    // only on the front end; don't mess with Admin scripts
    if ( ! is_admin() ) {
        // Only enqueue the core-bundled jQuery script
        wp_enqueue_script( 'jquery' );
    }
}
// Enqueue at proper hook
add_action( 'wp_enqueue_scripts', 'my-theme_enqueue_scripts' );

Notes:

  1. Omit the hard-coded link to jquery-1.3.2.min.js entirely.
  2. You don't want to enqueue both version 1.6.1 (which is bundled with WordPress) and version 1.3.2 (which is bundled with the Theme). Just use the core-bundled version.

If the Theme is adding any other scripts (such as e.g. SuperFish), these should be enqueued properly, as well. Non-core-bundled scripts simply have to be registered before they can be enqueued. To modify our previous function:

function my-theme_enqueue_scripts() {
    // only on the front end; don't mess with Admin scripts
    if ( ! is_admin() ) {
        // Only enqueue the core-bundled jQuery script
        wp_enqueue_script( 'jquery' );
        // Register our superfish script, dependent upon jquery
        wp_register_script( 'superfish', get_template_directory_uri() . '/includes/js/superfish.js', 'jquery' );
        // Enqueue superfish script
        wp_enqueue_script( 'superfish' );
    }
}
// Enqueue at proper hook
add_action( 'wp_enqueue_scripts', 'my-theme_enqueue_scripts' );

This will force WordPress to enqueue SuperFish after jQuery is enqueued.

Repeat for all hard-coded script links in the document head.

share|improve this answer
    
This doesn't actually fix the underlying problem, which is incorrect queueing of jQuery. WordPress bundles its own version of jQuery, which other Plugins will assume to be available. When a Theme or Plugin hard-codes its own version of jQuery, then conflicts inevitably arise. So, two things: 1) always enqueue jQuery using wp_enqueue_script( 'jquery' ), and hooked into wp_enqueue_scripts; and 2) don't use versions of jQuery that are different from the core-bundled version, because doing so will break other Themes/Plugins. –  Chip Bennett Jul 6 '11 at 15:46
    
@Chip, fair enough. Would this be more suitable? <?php wp_enqueue_script("jquery"); ?> <?php wp_head(); ?> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/includes/js/jquery-1.3.2.min.js"></script> –  Magellan Jul 6 '11 at 17:48
    
I then added the jQuery.noConflict(); code right before the superfish code and everything works fine, now. Superfish and FCG work great. –  Magellan Jul 6 '11 at 17:50
    
if you wouldn't mind me editing your answer, I can post example code for proper enqueueing of front-end scripts? –  Chip Bennett Jul 6 '11 at 17:57
    
Be my guest! :) –  Magellan Jul 6 '11 at 20:04
show 1 more comment

I'm having this issue on two of my sites, as well. I discovered that the code in the header.php file for my theme (a customized version of Woothemes' Original Premium News) is not "correct" according to a few jQuery websites. This is what it says:

<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/includes/js/jquery-1.3.2.min.js"></script><?php wp_head(); ?>

The sites I read said that you should insert the code below before the wp_head code and then put your jquery request after the wp_head code. In essence, it should look like this:

<?php wp_enqueue_script("jquery"); ?><?php wp_head(); ?><script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/includes/js/jquery-1.3.2.min.js"></script>

When I did this, my superfish dropdowns worked perfectly (or as well as they did yesterday). Unfortunately, when I did this it broke my graphic slider (powered by the Featured Content Gallery plugin).

That's as far as I've gotten after banging away at it for a few hours... :p

share|improve this answer
add comment

WooThemes is a commercial Theme development shop; they are the only ones who can correct your Theme's jQuery conflicts. I would suggest contacting their official support:

http://www.woothemes.com/support/

EDIT

Quoting from the OP's comment in the accepted answer:

"...you are right they are the only actual people who can solve this".

As WooThemes are commercial Themes, anyone who has not purchased the Theme (such as all of the WPSE volunteers) does not have access to the Theme template files. As such, while we can see the rendered output of the Theme, we can't actually see the underlying code that is causing the jQuery conflicts.

We can guess, but there's no guarantee that we'll be correct. Thus, I completely disagree with the assertion that it is "patently untrue" that WooThemes support are the only ones who can resolve the issue.

share|improve this answer
2  
As this has caused some angst, the reason I downvoted this is that it's patently untrue to suggest that "they are they only ones who can correct this" –  anu Jul 6 '11 at 13:55
    
I disagree with your assertion that it is "patently untrue" to suggest that WooThemes are the only ones who can correct the issue. See answer edit. –  Chip Bennett Jul 6 '11 at 14:52
2  
Well, I'm not WooThemes support, but I have access to the theme, therefore I could, if I wanted, have a go at working this out. The OP can also put the code somewhere for inspection. It might not be ideal, but it's certainly possible. There's a difference between "you should probably go to WooThemes support" and "they are the only ones that can solve this" –  anu Jul 6 '11 at 16:05
2  
One clarification - commercial or not, WooThemes release their themes under a GPL license, so its perfectly OK for a user to share the theme code with others to get support on an issue like this. –  goldenapples Jul 6 '11 at 16:09
add comment

The demo site is also broken: http://demo.woothemes.com/?name=premiumnews

I've been working on this for hours now. found this on wordpress.org forum:

make sure you are using

jQuery(document).ready(function($) {

and not

$(document).ready(function() {

and, if that doesn't resolve it, make sure your accordion menu script works OK with jQuery 1.4.2 and does not require an earlier jQuery version. Some older scripts require earlier versions.

share|improve this answer
    
I (@metaprinter) just got a tweet from @woothemes saying they're working on it ASAP. –  metaprinter Jul 6 '11 at 17:15
    
The DEMO SITE IS NOW WORKING... kind of. The Cat menu and sidebar animation on hover are working, but the Featured News and Tabbed Widget are still not working. –  metaprinter Jul 7 '11 at 16:59
    
Here's what's in the new Changelog: 2011.07.07 - version 2.4.3 * header.php - Moved JavaScript file calls to /includes/theme-js.php. Cleaned header JavaScript snippet. * /includes/theme-js.php - Added wp_enqueue_scripts for all JavaScript files used in the theme & removed call for easing.js –  metaprinter Jul 7 '11 at 17:19
add comment

Just to chime in here...what I had to do to solve this was to first deregister WordPress' copy of jquery and then register a google hosted copy of version 1.4.4 of jquery for all my scripts to work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.