How do I add a simple jQuery script to WordPress?

后端 未结 18 1952
心在旅途
心在旅途 2020-11-22 16:53

I read the Codex and a few blog posts about using jQuery in WordPress, and its very frustrating. I\'ve got as far as loading jQuery in functions.php file, but a

18条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 17:44

    I know what you mean about the tutorials. Here's how I do it:

    First you need to write your script. In your theme folder create a folder called something like 'js'. Create a file in that folder for your javascript. E.g. your-script.js. Add your jQuery script to that file (you don't need

提交回复
热议问题