The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript WORDPRESS: Added wp_head() to header and now my jquery scripts do not work

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #46008

    I recently added the `wp_head()` tag to my header before ``, in order to get my Woocommerce custom CSS working.

    Without that tag my Woocommerce Pages are totally plain with no styling to any of the elements.

    After adding to header, my Jquery scripts stopped working.
    I currently have these scripts included//

    When I view my page the flexslider doesn’t change slides at all. I also have a slideDown/slideUp animation on my drop down menu. But that doesn’t work either it just appears instead of animating…

    The overall issue is `wp_head()` interfering with scripts…

    I tried adding

    if( !is_admin()){
    wp_register_script('jquery', (""), false, '1.10.1');

    But all that does is remove my flexslider completely, and leaves the container blank.

    What can I do to be sure that, while using `wp_head()`, my other jQuery plugins will still work?

    PLEASE, help.
    Thanks in advance!


    Can you make a codepen of the header.php file that you put the wp_head() call in? It should have already had that call in there, it’s theme dependent but most of them do.That’s why I’m curious. Also what theme are you using?


    @JohnMac4 I created this theme from scratch, so the `wp_head()` was not originally included…
    Here is a codepen of my [header.php](”)


    @JohnMac4 If any other files need to be viewed in order to try and help me fix this… please let me know.


    I would guess it might be because you have not enqueued your scripts. Check out the codex here:


    @eristic So for flexslider I’d use//

    function my_scripts_method() {
    get_template_directory_uri() . '/inc/js/jquery.flexslider.js',
    array( 'jquery' )

    add_action( 'wp_enqueue_scripts', 'my_scripts_method' );


    This is all new to me.

    Thanks for your time and help by the way.


    @erisitc Or am I suppose to add the Google Library some how?


    I managed to get my flexslider and animated drop down menu to work again…
    I have a Videos page that has a separate header and there is no flexslider included.
    There I hovered over my navigation and the drop down menu is animated.
    So that is when I came to realize it had to be the flexslider causing the issue.

    So I went to my main header.php and removed flexslider.js and easing.js.
    Visited my page, and the animation worked.
    I didn’t want a blank container though! So I went back into header.php, added the easing and flexslider again. Then instead of both I only removed the easing.js plugin…

    Visited my page once more and now the slider as well as the animated menu works.
    I have no idea why easing.js caused such a problem…
    I wish I was a programmer/developer to understand!!!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.