lundi 5 octobre 2015

rewrites and custom links in page

I have one page with edited permalink, like, address.com/detail/ I need to send there some values by GET request, so i would like the link looks like /detail/value1/value2/

i added this code in

add_action('init', 'rewrite_rules');  
function rewrite_rules(){
    add_rewrite_tag('%value1%', '([^&]+)');
    add_rewrite_tag('%value2%', '([^&]+)');
    add_rewrite_rule('detail/([^/]*)/([^/]*)/?$','detail/?value1=$matches[1]&value2=$matches[2]', 'top');
}

but it doesn't work actually, and i can't get which rewrite rule structure i should use to make it works. value1 and value2 was added to wp_query array. may anyone help?

flush_rewrite_rules

didn't help, also



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire