passing json in wordpress to our js file

27 views Asked by At

I'm currently working on a custom WordPress theme where I need to connect a JSON file with my JavaScript code. Despite my efforts, I've encountered difficulties achieving this integration. However, none of these approaches have successfully resolved my issue. Specifically, I've ensured that my JSON file is correctly formatted and accessible within the theme directory. I've also double-checked the paths to my files to ensure they're accurate.

1

There are 1 answers

1
Alex On

@ubaid, give us a little more info. Some snippets and detailed description of the task will help a lot.

Do you need to open the JSON files on page load in JS or via Ajax on some action execution?