2017-05-04 41 views
1

沒有工作,我有這樣的一個http://localhost/leneufbreton/achat-immobilier-neuf/programme-neuf/?ville=brest URL,我想轉換爲相應的http://localhost/leneufbreton/achat-immobilier-neuf/programme-neuf/bresthttp://localhost/leneufbreton/achat-immobilier-neuf/programme-neuf-brestadd_rewrite_rule在WordPress

我試圖用add_rewrite_rule但沒有happend。 這是我使用的代碼動作:

function custom_rewrite_basic() { 
    add_rewrite_rule('^programme-neuf/([^/]*)/', 'programme-neuf/?ville=$matches[1]', 'top'); 

} 
add_action('init', 'custom_rewrite_basic'); 

有什麼想法嗎?

回答

0

試圖逃跑的美元符號\

add_rewrite_rule('^programme-neuf/([^/]*)/', 'programme-neuf/?ville=\$matches[1]', 'top'); 
相關問題