How to add WordPress php code into JavaScript?

Posted by Jennifer | Updated on

Want to add WordPress php code into JavaScript? You need to set variable in template:

and than, in your JS file use it:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers