Multiple query vars sorting combination and url rewrite

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

Help with rewrite rules for two post types

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

Replace term archives with static pages

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);