Here is my rewrite rule code: add_rewrite_rule('tides/([^/]+)/([^/]*)', 'index.php?page_id=4348&location=$matches&month=$matches', 'top'); add_rewrite_tag('%location%', '([^&]+)'); ...
Rewrite Rule & Regex - Extract 'cat-name' and 'page-number' from http://domain.com/custom-post-type/category/cat-name/page/page-number
I have an URL formatted so: http://domain.com/custom-post-type/category/cat-name/page/page-number I need to extract: cat-name and page-number So that in my functions.php, I can create the custom ...
I am trying to add a custom field to the post permalinks by using a combo of add_rewrite_tag and applying a post_link filter. What I am aiming for is something like this: ...
I have a rewrite rule that needs to allow me to add 1-3 variables to the end of a page, the variables are then accessed by a plugin using a shortcode. This is the base page: ...
I've setup a very specific function and it works well but I'd like to make the parameters optional but I can't get a handle on the regex bit: add_rewrite_rule('whats-on/([^/]+)/([^/]+)/([^/]+)/?$', ...
ive been trying to rewrite a shop uri, and what i have now is this code: add_filter('rewrite_rules_array','wp_insertMyRewriteRules'); add_filter('query_vars','wp_insertMyRewriteQueryVars'); ...