get db values for external js file
You need to use wp_localize_script() when you enqueue the js script. It’s usually a good alternative of ajax way and this will save you to create multiple js files. wp_localize_script() can be used to make any data available to your script that you can normally only get from the server side of WordPress. As you … Read more