Rewrite rules goes away

properties_add_rewrite_rules should be hooked to init so it runs on every request. Rules can be flushed at any time- loading the permalinks settings page calls flush_rewrite_rules, and your rules weren’t added on that request, so they disappear.

Problem with add_rewrite_tag

cat is a reserved query variable used for the ID of a post category. To avoid conflicts with WordPress and/or other plugins and themes I’d recommend you ‘namespace’ your query variables eg eddh_cat instead of cat

Custom taxonomy Rewrite Rule

You could use 2 of WordPress’ built in functions to get the result you’re after. add_rewrite_tag() and add_rewrite_rule() There is an example of how to use these tags to get the result you want about halfway down this page https://codex.wordpress.org/Rewrite_API/add_rewrite_rule. Note: remember to flush your rewrite rules.

Rewriting URLs with a query string

First of all, you have to make sure to register your public query vars with WordPress so it recognizes your rewrite rule vars. Add this code on your functions.php file: add_rewrite_rule(‘^(tips)/([^/]*)/([^/]*)/?’, ‘index.php?name=$matches[1]&id=$matches[2]&filter_id=$matches[3]’,’top’); add_filter(‘query_vars’, ‘foo_my_query_vars’); function foo_my_query_vars($vars){ $vars[] = ‘id’; $vars[] = ‘filter_id’; return $vars; } After that, enter on your Permalinks Settings page to flush … Read more