WordsfromWoo
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Subdomain Insert Running Numerous timesI have wordpress installed on the public html and in the folders of each subdomain. Maybe I should be doing it differently. And there are databases for all three.
Forum: Plugins
In reply to: Passing variables through permalink urlOk I figured it out. I didn’t understand how rewrite worked. For people who need help doing more then one page it is simple. Just add another rule.
$bNewRules = array('flight-school/([^/]+)/?$' => 'index.php?pagename=flight-school&flight_cat=$matches[1]'); $aRules = $aNewRules + $bNewRules + $aRules; return $aRules; }I used
function get_rewrite_urls(){ global $wp_rewrite; return $wp_rewrite->wp_rewrite_rules(); /* Returns an array */ } print_r(get_rewrite_urls());and I put it on the page that I was trying to see if the rewrite was working on. If you did it properly you should see your rewrite variable in code. Mine was in the front. Be sure to add the flush or else you won’t see it there and will spend numerous times refreshing the page wondering why it isn’t showing up on the print_r.
‘function add_query_vars($aVars) {
$aVars[] = “aerial_cat”; // represents the name of the product category as shown in the URL
$aVars[] = “flight_cat”;
return $aVars;
}’be sure to add the new variable to your add_query_vars. I hope this helps more people on this topic!
Forum: Plugins
In reply to: Passing variables through permalink urlI am trying to pass numeroues variables to the rewrite method. I have two pages or more I would like to do it. I got one working but don’t know how to do two. I think your post to your solution up there might work but am confused `function add_query_vars($aVars) {
$aVars[] = “aerial_cat”;
$aVars[] = “flight_cat”; // represents the name of the product category as shown in the URL
return $aVars;
}function add_rewrite_rules($aRules) {
$aNewRules = array(‘aerial-photography/([^/]+)/?$’ => ‘index.php?pagename=aerial-photography&aerial_cat=$matches[1]’);
$aNewRules = array(‘flight-school/([^/]+)/?$’ => ‘index.php?pagename=flight-school&flight_cat=$matches[1]’);$aRules = $aNewRules + $aRules;
return $aRules;
echo “Rewrite Rules: <pre>”.print_r($aRules, true).”</pre>”;
}
add_filter(‘rewrite_rules_array’, ‘add_rewrite_rules’);
`
tell me what you think please it would be a nice tool when thinking of solutions