add_rewrite_rule
is very handy for this use, first add your custom rule for this:
add_action('init', function(){
return add_rewrite_rule(
'([^/]+)/area/([^/]+)/?$',
'index.php?pagename=$matches[1]&area=$matches[2]',
'top'
);
});
and you already registered the custom query variable, next is (because you’re in development) go to admin > settings > permalinks
and save settings to flush the rewrite rules.
Now to get the custom area
, just call get_query_arg('area')
which will return the value when WP_Query is ready.