Passing browser infos to the wordpress function.php as a $_GET
[system:get:my_query_var] – // print the variable stored inside $_GET // .
So it´s these steps:
my_variable_name = $(window).innerWidth()
And then the “token”-Script is pulling the data with
[system:get:my_variable_name]. Which is a plugin script. So I don´t want to change that.
If I understand this …
https://docs.dynamic.ooo/article/116-dynamic-tags-token -> “Use “SYSTEM”, to retrieve data from the System (like a parameter, a server configuration or constant)”
https://docs.dynamic.ooo/article/25-tokens -> “
[system:get:my_query_var] – print the variable stored inside $_GET, also compatible with POST, SESSION, COOKIE and SERVER systems vars;”
…correctly: the [system:get:my_variable_name] shortcode/token is looking into the function.php file to get the variable.
So my questions are:
- What is the easiest way and correct syntax to get this running within the wordpress environment using the example situation of looking for the browser width?
- Do I write all code into the function.php or do I need to create a seperate script document or use another existing one?