0
我有两个自定义分类“编辑”和“功能”WordPress的前缀动态值,以自定义分类网址
我想WordPress的,让我从一个版本值前缀的特点蛞蝓。
例如,如果我去这里;
mysite.com/asia/features/interviews/
的WordPress将转化的URL;
mysite.com/index.php?features=interview &版=亚洲
,然后加载特征分类模板,我可以然后抓住版query_var并相应地过滤模板。
我想玩弄add_rewrite_rule会排序它不确定。
任何帮助表示赞赏
干杯
UPDATE
好吧,我觉得我半右边线,我已经写了重写规则;
RewriteRule ^(media|asia|uk)/([^/]+/)*(^/)? index.php?feature=$2&department=$1
这需要一个url像;
www.mysite.com/media/features/interviews/face-to-face/
但它将其转换为;
index.php?feature=face-to-face/&department=asia
一些我需要摆脱最后/但我不够熟练的正则表达式来解决它。
有什么想法?
现在解决了。正确的重写是; 'RewriteRule ^(media | asia | uk)/([^ /] + /)*([^ /] +)/? index.php?feature = $ 3&department = $ 1' 因此,现在我可以将分类学网址作为媒体,亚洲或英国的前缀,它将成功跳转到正确的分类术语页 谢谢 – joemcc 2013-04-28 02:20:52