Using the permalink rewrite with more than 2 variables in the URL
-
Hi. I am batlting with something. I want to pass $_GET variables ( via the URL ) but still use the permalink structure wordpress offers.
I have managed to get this right with one $_GET variable however, I cant get it to work with more then one.
Here is my current code:
function add_query_vars($aVars) { array_push($aVars, 'sid'); return $aVars; } // hook add_query_vars function into query_vars add_filter('query_vars', 'add_query_vars'); function add_rewrite_rules($aRules) { $aNewRules['portfolio/([^/]+)/?$'] = 'index.php?pagename=portfolio&sid=$matches[1]'; $aRules = $aNewRules + $aRules; return $aRules; } // hook add_rewrite_rules function into rewrite_rules_array add_filter('rewrite_rules_array', 'add_rewrite_rules');
This works fine for one var, but can anyone help me with using two vars.
- The topic ‘Using the permalink rewrite with more than 2 variables in the URL’ is closed to new replies.