WordPress.org

Ready to get started?Download WordPress

Forums

wp_enqueue_script and the jQuery plugins (7 posts)

  1. mores
    Member
    Posted 4 years ago #

    adding these lines to my header.php

    <?php wp_enqueue_script( 'jquery' ); ?>
    	<?php wp_enqueue_script( 'jquery-color' ); ?>

    will properly load jQuery, but fails with the jQuery-color plugin.

    Ees dees a bug?

  2. Mark / t31os
    Moderator
    Posted 4 years ago #

    Confirmed, absolutely nothing when attempting to do the same..

    I don't use it, just wanted to confirm for you... ;)

    Tried other variants of the name to check for simple typos.

    jquery-Color
    Jquery-Color
    Jquery-color
    jquerycolor

    Thought it was worth a shot.. :) No difference though..

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 years ago #

    Worked fine for me.

    All I used was wp_enqueue_script( 'jquery-color' ); and it loaded both jquery and jquery-color.

    Considering it's loaded on every admin page, I think you'd rapidly notice if it was broken.

  4. Mark / t31os
    Moderator
    Posted 4 years ago #

    Ok i tried your method..

    Result Source:

    <script type='text/javascript' src='http://localhost/wp-includes/js/jquery/jquery.js?ver=1.3.2'></script>

    No jQuery color...

    Seems to load the jQuery fine, but ignores the color one... i'm doing this in the theme's header.php for what it's worth.. is it reserved for admin only areas?

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 years ago #

    I think that jquery-color is one of the footer scripts. It's not loaded in the header by default. Look in the footer.

  6. S.K
    Member
    Posted 4 years ago #

    Yes. It is snug in the footer!

    S.K

  7. mores
    Member
    Posted 4 years ago #

    Won't work for me. I'm talking about using it in the theme, as in front-end. Not the admin.
    I am now loading them manually ...

Topic Closed

This topic has been closed to new replies.

About this Topic