Now I have problem related to URL rewrite when I using form on Method "Get" with wordpress and can't rewrite url from http://ift.tt/1IlA2ey to "http://ift.tt/1ahKCZM"
This is my code in Wordpress function.php file
add_action('init', 'custom_rewrite_url');
function custom_rewrite_med() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
add_rewrite_tag('%goodsType%','([^&]+)');
add_rewrite_tag('%city%','([^&]+)');
add_rewrite_tag('%prices%','([^&]+)');
$wp_rewrite->add_rule('normalurl/([^/]+)/([^/]+)/([^/]+)','index.php?goodsType=$matches[1]&city=$matches[2]&prices=$matches[3]','top');
}
add_filter('query_vars', 'my_query_vars');
function my_query_vars($vars){
$vars[] = 'goodsType';
$vars[] = 'prices';
$vars[] = 'city';
return $vars;
}
But my solution not luck, I wish all of you will help me on this problem. Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire