Get URL Parameter
-
Hello guys,
i have a custom tracking using parametermy example url: https://domainname.com/permalink?type=1
now i’m trying to get the URL Parameter of ‘type’
i tried:
$type = get_query_var( 'type');
OR
add_filter('query_vars', 'geturlparam' ); function geturlparam( $qvars ) { $qvars[] = 'type'; return $qvars; }
THEN on the functions.php i use:
global $wp_query; $wp_query->query_vars['type'];
But none of them work.. at the moment i’m using $_GET but i don’t feel safe with it
- The topic ‘Get URL Parameter’ is closed to new replies.