Wordpress: problem with adding another rule using wp_rewrite

I set mypresspress permlink to /%category%/%postname% Now I use Gallery Nextgen, so when I have a gallery on the page, it will be something like /cat/page?gallery=10 I want to do something like cat/page/gallery id/ wp_rewrite ... but no luck ... any help?

this is what I'm testing .. this is not my code that it provided from wordpress ... I would put everything in its place when I found a way ... so don't worry, I will not flushRules on init ... thank you very much

 add_filter('rewrite_rules_array','wp_insertMyRewriteRules'); add_filter('query_vars','wp_insertMyRewriteQueryVars'); add_filter('init','flushRules'); // Remember to flush_rules() when adding rules function flushRules(){ global $wp_rewrite; $wp_rewrite->flush_rules(); } // Adding a new rule function wp_insertMyRewriteRules($rules) { $newrules = array(); //i don't know what should i put here $newrules[''] = ''; return $newrules + $rules; // } // Adding the id var so that WP recognizes it function wp_insertMyRewriteQueryVars($vars) { array_push($vars, 'id'); return $vars; } 
+4
source share
1 answer

Hope you find these 2 URLs in the right direction:

Perhaps a Google keyword search will save you a lot of time ... :)

Sincerely.

0
source

All Articles