Custom Fields Query Vars and Rewrite not working
Custom Fields Query Vars and Rewrite not working
Custom Fields Query Vars and Rewrite not working
so the problem with the colon is that it has no special meaning so your regex is looking to match :/ literally – that would work for a string with a structure like: /madagascar/subpage:/2 you would get a full match and 4 groups: array ( [0] => ‘madagascar/subpage:/2’ [1] => ‘madagascar’ [2] => ‘subpage’ [3] … Read more
Usw add_rewrite_rule to display frontpage on specific page
You can use author_rewrite_rules filter to change rules to look like ones you want them to look, and then implement redirection on request or template_redirect filters/actions. P.S. URL you want to implement isn’t really good as it already fits to the page rewrite rules.
It is kind of solution but it worked. I just use plugin called “Allow Numeric Slugs” https://pl.wordpress.org/plugins/allow-numeric-stubs/ It went out it also allow me to create pages as I need http://pagename.example/2018 etc… I don’t investigated how it work, but it worked for me 🙂
The rewrite rules to resolve these requests are fairly simple: function wpd_property_rules(){ add_rewrite_rule( ‘property-city/([^/]+)/([^/]+)/page/?([0-9]{1,})/?$’, ‘index.php?property_city=$matches[1]&property_type=$matches[2]&paged=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘property-city/([^/]+)/([^/]+)/?$’, ‘index.php?property_city=$matches[1]&property_type=$matches[2]’, ‘top’ ); } add_action( ‘init’, ‘wpd_property_rules’ ); There are a couple of problems though. You’ll need to generate these links somehow, but there’s no relationship between two taxonomies except by looking at all posts to … Read more
Remove “category” from permalink with add_rewrite_rule
Added a prefix in URL permalink structure but the old structure still working!
Rewrite post type into a page with year filter
Using meta_key & meta_value in add_rewrite_rule