Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

citstudio on "Adding Rewrite Rule"

$
0
0

hi there,

I Create

function add_query_vars($aVars) {
$aVars[] = "type";
return $aVars;
}

add_filter('query_vars', 'add_query_vars');

function add_rewrite_rules($aRules) {
$aNewRules = array('career/application-form/job-opportunities/([^/]+)/?$' => 'index.php?pagename=application-form&type=$matches[1]');
$aRules = $aNewRules + $aRules;
return $aRules;
}

add_filter('rewrite_rules_array', 'add_rewrite_rules');

But when I go to career/application-form/job-opportunities/
the page redirect to career/application-form/

on the page, I create :
if(isset($wp_query->query_vars['type'])) {
$sMsdsCat = urldecode($wp_query->query_vars['type']);

to display job-opportunities.

But it doesn't work.

Thank's


Viewing all articles
Browse latest Browse all 8245

Trending Articles