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

Home Forums JavaScript Insert jQuery into wordpress post Reply To: Insert jQuery into wordpress post


Thanks you for help.
Code as above works perfectly and as expected if placed after a document ready function in header.php.
If I save same code in a xxx.js file and then I enqueue the script the correct way, it doesn’t work…Should I modify the code one way or another to make it work when loaded from a specific file ?
As you advise I can then use conditional tags to load it only for pages or even posts I choose.
Any ideas ?