/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function add_my_var($public_query_vars) { $public_query_vars[] = 'myvar'; return $public_query_vars; } add_filter('query_vars', 'add_my_var'); function do_rewrite() { add_rewrite_rule('artists/(.+?)/(.+?)?$', 'index.php?pagename=artists/$matches[1]&myvar=$matches[2]','top'); } add_action('init', 'do_rewrite');