• Hiya. I’m trying to follow a simple jQuery tutorial, but WordPress doesn’t seem to understand jQuery in its most natural form and I need help.

    I don’t know jQuery and I’m trying to follow this tutorial: http://spoiledmilk.com/blog/sticky-sidebar/ to create a sticky sidebar on my blog design.

    I do not know jQuery, but I have been reading about and failing to implement custom jQuery in WordPress for years; so please do not try to teach me jQuery. Instead, please tell me how to convert the jQuery I find to something WordPress can use. I still think that kind of lesson will sustain itself for me in the long term. After all I’ve studied, just replacing $ with jQuery just hasn’t been enough to get things working! 😛

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Charles Mabe

    (@charlesmabe)

    Moderator! There’s a spammer on my thread, taking it off the no-replies list and reducing my chances of getting responded to. D:

    To get a moderator to look at the thread, you need to add a modlook tag to it (which I’ve done). They do take care of spam links like that very quickly. 🙂

    Now, for your issue, it’s very hard to say what is actually wrong. Iv’e been using jQuery code in WordPress for years and not had a problem. It’s been a mix of code that I’ve written myself and code that’s been written by others, so I can assure you that WordPress does handle jQuery stuff fine. The big issue is the noconflict mode – but have a read of this and you’ll see how you can get around that:

    https://codex.ww.wp.xz.cn/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers

    And just remember… there’s always a possibility that the code that you’re using just doesn’t work and it’s nt jQuery’s fault. You need a good JavaScript console window so you can see what’s happening and what errors are there. That is always the best way to get to the bottom of why something is not working as you expect.

    Got it – thanks :)! Sorry we missed it earlier.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Converting jQuery to something functions.php can use.’ is closed to new replies.