Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9197973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:11:13+00:00 2026-06-17T22:11:13+00:00

OK so I have a WordPress site. It uses quite a few jQuery scripts

  • 0

OK so I have a WordPress site. It uses quite a few jQuery scripts and jQuery is loaded in the pages’ headers. I have a small block of code that should simple add a class to image links. I have placed this at the bottom of the document, just before the </body> tag.

<script type="text/javascript">
$.noConflict();
$(document).ready(function () {
$('a[href*=".png"], a[href*=".gif"], a[href*=".jpg"]').addClass('zoom');
});
</script>

The script does not work and Firebug is giving me a $ is undefined error. I have checked various similar other question and the answers do not seem to help.

The source page is here: http://sergedenimes.com/2013/01/bruno-bisang-30-years-of-polaroids/

I’m sure it is another plugin causing a conflict but I would appreciate any guidance on how to solve this.

Edit: Wow thanks for the very rapid response. Seems it was an earlier plugin rendering $ undefined. Replacing with jQuery has solved.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:11:13+00:00Added an answer on June 17, 2026 at 10:11 pm

    $.noConflict(); makes the $ symbol go back to it’s previous definition before jQuery was loaded. If there were no other libraries using that symbol, then it goes back to undefined. That is its purpose.

    If you’re going to use that and not define any other symbol as a shortcut for jQuery, then you must use jQuery as the symbol for jQuery functions instead of $.

    Do this instead:

    <script type="text/javascript">
    $.noConflict();
    jQuery(document).ready(function () {
        jQuery('a[href*=".png"], a[href*=".gif"], a[href*=".jpg"]').addClass('zoom');
    });
    </script>
    

    or, if you’re only trying to use $ inside the .ready() handler, then you can assign it using a feature of .ready() like this:

    <script type="text/javascript">
    $.noConflict();
    jQuery(document).ready(function ($) {
        $('a[href*=".png"], a[href*=".gif"], a[href*=".jpg"]').addClass('zoom');
    });
    </script>
    

    or if you have code that isn’t just in the .ready() handler that wants to use $, you can redefine $ in a closure which lets other libraries use $ in their own code, but you can use it for jQuery in your jQuery code inside the closure:

    <script type="text/javascript">
    $.noConflict();
    (function($) {
        $(document).ready(function () {
            $('a[href*=".png"], a[href*=".gif"], a[href*=".jpg"]').addClass('zoom');
        });
        $.each(whatever...)
    })(jQuery);
    </script>
    

    or, you can define a new shortcut symbol for jQuery:

    <script type="text/javascript">
    var $$ = $.noConflict();
    $$(document).ready(function () {
        $$('a[href*=".png"], a[href*=".gif"], a[href*=".jpg"]').addClass('zoom');
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Wordpress site that uses a JQuery plugin called Hover-Caption ( https://github.com/coryschires/hover-caption
I have a Wordpress site that uses two databases -- one section queries one
I have a website that runs on WordPress. The site uses several JavaScript components.
I have a site that uses wordpress for community purposes, it is installed under
I have a problem with a wordpress site that uses nextgen gallery(powered by supersized)
I have a WordPress site (on my localhost) that uses a <ul> for a
I have a site that uses wordpress for the frontend & a Codeigniter app
I have a one-page wordpress site. It uses pages and posts but is all
My company has a custom build wordpress child theme that uses a small jquery
I have a WordPress site which have 4 pages with one page is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.