JS error on every theme -Uncaught ReferenceError: jQuery is not defined

Hi, again

On every theme I tried, I got the following javascript errors when I look the page with chrome (and enabled “inspect element”:wink:

Uncaught ReferenceError: jQuery is not defined     dropmenu.js:2
Failed to load resource: the server responded with a status of 404 (Not Found) ..../wp-content/themes/black-letterhead/none

I’m pretty sure the problem is on the functions.php file of each theme and more specific at the add_wp_menu_drop_js_script()function , which is in all themes the same and doesn’t use the enqueue_script. But I don’t know how to fix it.

Can someone help?

I use WP mulisite 3.5.1 , BP1.6.5 and the only plugins I have enabled so far are

BP Groupblog, BuddyPress, BuddyPress Group Calendar, Sidebar Login widget

Thanks in advance

Lena

  • Vaughan
    • Ex Staff

    hi @stergatu

    thanks for posting.

    This sounds like the Jquery library is maybe out of date or different.

    I can’t replicate the issue on my test server. I have installed 3 themes from the pack, including the black-letterhead you mentioned, but do not receive that error.

    could you possibly post a link to the site so that we can take a look (make sure that theme is enabled)

    thanks

  • stergatu
    • Site Builder, Child of Zeus

    Hi Vaughan, thanks for the prompt reply.

    Unfontunatelly I can’t post a link, cause it’s on a development server accessible only from a closed network. But I found the solution for both problems.

    1. For Uncaught ReferenceError: jQuery is not defined dropmenu.js:2 the solution is to replace in functions.php from each theme the

    `function add_wp_menu_drop_js_script() {

    ?>

    <script type=”text/javascript” src=”<?php bloginfo(‘template_directory’:wink:; ?>/js/dropmenu.js”></script>

    <link rel=”stylesheet” href=”<?php bloginfo(‘template_directory’:wink:; ?>/nav.css” type=”text/css” media=”screen” />

    <?php

    }

    add_action(‘wp_head’, ‘add_wp_menu_drop_js_script’:wink:;`

    with

    `function add_wp_menu_drop_js_script() {

    wp_enqueue_script(‘dropmenu’, get_template_directory_uri() . ‘/js/dropmenu.js’, array(‘jquery’:wink:);

    wp_enqueue_style(‘nav’, get_template_directory_uri() . ‘/nav.css’, array(), false, ‘screen’:wink:;

    }

    add_action(‘wp_enqueue_scripts’, ‘add_wp_menu_drop_js_script’:wink:;`

    which forced the dropmenu.js to load after jquery.

    2. The Failed to load resource: the server responded with a status of 404 (Not Found) ..../wp-content/themes/black-letterhead/none is cause by:

    /nav.css line ~52

    #nav li li{
    background: url(none)!important;

    in should by replaced with

    #nav li li{
    background-image: none !important;

    Please inform the Farms 133 theme pack developer about these two suggested fixes, it order to confirm if they are OK to use.

    Thanks Lena