Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #2743422
How to add custom jquery to theme
Closed

Comments

  • jakegroup started the conversation

    Hi I would like to add custom jquery to the theme. I found that I can add custom JS in the Advanced options, but what is the correct way to add Jquery code (jQuery prefix)?

    I tried the following, but none of them worked.

    jQuery( document ).ready(function() {
        console.log( "ready!" );
    });

    $( document ).ready(function() {
        console.log( "ready!" );
    });

    $j( document ).ready(function() {
        console.log( "ready!" );
    });

    Thanks,

  •  7,092
    Oliver replied

    Hi,

    Example:

    (function($){
        $(function(){
        console.log( "ready!" );
    })})(jQuery);
    

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver