Hi.
I would like to setup a page on my website which can grab a query string called token from the url.
It would look like this:
http://www.hytech.dk/tokensuccess/?token=foo
I therefore create a child theme and add the following function to functions.php as described by the wordpress codex.
function add_query_vars_filter( $vars ){
$vars[] = "token";
return $vars;
}
add_filter( 'query_vars', 'add_query_vars_filter' );
get_query_var('token');
Then on the webpage I insert a raw content box and write like this:
<?php $token = add_query_vars_filter( 'token', $default = ''); ?>
<h1>Currently Browsing token <?php echo $token; ?> On a static front page</h1>`
Hoping that it would write the value of the token in the text. However I do only see written
Currently Browsing token On a static front page
not
Currently Browsing token foo On a static front page
as I was hoping.
How can I achieve this and how can I insert the token value into the database?
Thanks a lot for any help!
Best regards
Flemming