URL $_GET will not work URL $_GET will not work wordpress wordpress

URL $_GET will not work


Add add_rewrite_tag function in your function.php for all parameter :

function custom_rewrite_tag() {        add_rewrite_tag('%localidad%', '([^&]+)');}add_action('init', 'custom_rewrite_tag', 10, 0);

And you can call your parameter in template using

$wp_query->query_vars['localidad']

Here is the full documentation

Note that using $_GET on a rewritten URL will not work, even if the rewrite includes the querystring variables. You must use $wp_query.