JQuery Easing error with word press theme

I made a custom theme a few months back and it all worked just fine. However after updating word press and the plugins I had used and making some changes an error appeared in my code.

Console error:

TypeError: v.easing[this.easing] is not a function

Offending code:

block.children('.slide').not(':eq('+target+'), .slide-1').stop().hide('slide', {direction: 'right'}, 1000,function(){
    block.removeClass('animation');
});

Ineffectual code no longer working:

block.children('.readmore.next_page').children('.link').animate({color: new_color, borderColor: new_color}, 350);
block.children('.readmore.next_page').children('.link').children('.left').animate({color: new_color}, 350);
block.children('.readmore.next_page').children('.link').children('.right').animate({color: new_color}, 350);
block.children('.readmore.next_page').children('.link').children('.arrow').animate({color: new_color}, 350);

From what I know this is an issue with jQuery being included multiple times. My scripts were included the old fashioned way in the header along with a local copy of jquery and jquery ui separate from wordpress’ copy.

If I remove wp_head() from my header everything worked fine. So I thought I best update my header and functions file to conform with the correct way of enqueing scrips and now have the following.

Header.php

    //Header code

    <?php wp_head(); ?>
</head>

Functions.php

add_action('wp_enqueue_scripts', 'my_enquire', 999);
function my_enquire()
{

wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery-ui-core' );

// jQuery libraries I use elsewhere on the site that work fine //

wp_enqueue_script('script', get_template_directory_uri() . '/js/script.js', array(), '1.0.0', true);
wp_enqueue_script('story', get_template_directory_uri() . '/js/story.js', array(), '1.0.0', true);

}

Now all my files are being correctly loaded in the footer, but I’m still getting the same problems. Same error at the same place. And I’ve also edited my script files to include jQuery( document ).ready(function( $ ) { as from what I know jquery is included in no conflict from wordpress.

Read more here: JQuery Easing error with word press theme

Leave a Reply

Your email address will not be published. Required fields are marked *