Pass PHP variable to javascript

Question

Is there any possibility to pass some PHP variables in javascript so I can use them later?

Only in single.php.
I heard about wp_enqueue_scripts but with that it is neccesary to declare a path to a JS file, but I don`t need one.

0
, , , , Sebastian Corneliu Virlan 3 years 2020-07-20T11:10:33-05:00 0 Answers 57 views 0

Leave an answer

Browse
Browse