0

¡Hello!

I need some help...

I get this URL: https://mysite/entrevista-sesion/?Name=pedro

And I need to change the parameter's name to: https://mysite/entrevista-sesion/?n=pedro

I'm trying to accomplish this with rewrite rule like this:

function custom_rewrite_tag() { add_rewrite_tag('%Name%','([^&]+)');   } 

add_action('init', 'custom_rewrite_tag', 10, 0); 

function custom_rewrite_rule() 

{ add_rewrite_rule('^sesion-estrategia/?n=([^/]*)', 'index.php?page_id=12489&Name=$matches[1]', 'top'); } 

add_action('init', 'custom_rewrite_rule', 10, 0); 

function vars($vars) {   

  $vars[] = 'Name';
  return $vars; } add_filter('query_vars', 'vars');

Thank's for helping.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.