Support » Fixing WordPress » jQuery & wp-enqueue-script not playing nicely

  • Child theme of twentyeleven

    Hi im trying to make this bit of jQuery work on my page, mainly to understand how to get jQuery working in a WordPress child theme.

    So far I have come across nothing but brick walls after trying several thousand different combinations of the wp-enqueue-script.

    Here is a link to the code in my header.

    All it is, is a little script to make links fade in or out when hovered over. What i would love to know is, am i calling it properly?

    I have a blank functions.php file with just the wp_enqueue_script(‘jquery’); and a script to limit excerpt lengths.

    I tried putting the .js files in my child’s js folder and in the
    h**p://my_domain/wp-includes/js/jquery/my_plugin folder.

    I am running around n circles not knowing wether i`m just getting one bit of code wrong, a backslash here or a brace there??

    Here is the script:

    Tried taking the “$” and replacing with “jQuery” in the script to no avail.

    The only other thing i can think of is that some CSS rule is overwriting the script. Whatever it is i am blind to it.

    Please help. I never ran into any of this when dropping jQuery into static sites. Just want to understand how WP implements jQuery and to understand best practice going forward



Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘jQuery & wp-enqueue-script not playing nicely’ is closed to new replies.