Including taxonomy term before post type breaks top level pages
Including taxonomy term before post type breaks top level pages
Including taxonomy term before post type breaks top level pages
Rewrite tags aren’t used in the context of add_rewrite_rule. If you were to use your tag in the post permalink settings under Settings > Permalinks, then your tag would be present in the link passed to the post_link filter. I think you need to add a new permalink structure containing the tag directly to the … Read more
WordPress search rewriting
how to change permalinks format for pagination?
Permalink structure between 2 custom post types and a taxonomy
Add Taxonomy Subcategory To Permalink
Why does my URL rewriting only work using two different methods?
Well, I explain here what I finally did to sort this out. I haven’t found a proper way to do so but: I created a rewrite function that retrieves all parameters and generates a final URL with the parameters ordered in a specific way. function sc_change_programs_search_url_rewrite() { if(get_query_var( ‘post_type’ ) == ‘program’) { if(isset($_GET[‘word_search’]) || … Read more
The first rule is capturing all requests. If you add a $ anchor at the end of the rules, they’ll behave as expected (you could also just switch the order of the rules so the more specific one “wins”). add_rewrite_rule( ‘^app/course/([^/]+)/?$’, ‘index.php?page_id=3400&course=matches[1]’, ‘top’ ); add_rewrite_rule( ‘^app/course/([^/]+)/theme/([^/]+)/?$’, ‘index.php?page_id=3400&course=$matches[1]&theme=$matches[2]’, ‘top’ ); Check out Monkeyman Rewrite Analyzer for … Read more
I think this should work if library functions are used everywhere. function custom_term_archive_link($url, $term, $taxonomy) { if($taxonomy != ‘product_cat’) { return $url;} if( $term->name == ‘my_term’ ) { $url=”my_term_static_url”; } return $url; } add_filter(‘term_link’, ‘custom_term_archive_link’, 99, 3);