Is there a way to use rewrite rules in WordPress to correctly render a page or post?
Is there a way to use rewrite rules in WordPress to correctly render a page or post?
Is there a way to use rewrite rules in WordPress to correctly render a page or post?
Custom post permalinks for specific categories
Taxonomy archives based on Custom Post Types
Cannot use dynamic prefix for WooCommerce permalink
Adding Category to Child Posts Permalink
Changing the add_rewrite_rule did the trick: add_rewrite_rule(‘^periodicals/([^/]+)-‘.$tlv[‘code’].'[/]?$’, ‘index.php?periodicals=$matches[1]&post_type=periodicals&name=$matches[1]&mlang=’.$tlv[‘code’], ‘top’); So, I assume for custom post types, using add_rewrite_rule with index.php as query need some extra query variables. A sample will be as: add_rewrite_rule(‘^<custom_post_type>/([^/]+)-‘.$tlv[‘code’].'[/]?$’, ‘index.php?<custom_post_type>=$matches[1]&post_type=<custom_post_type>&name=$matches[1]&mlang=’.$tlv[‘code’], ‘top’);
Get URL parameters with rewrite rules
Display A Post At A URL without Redirecting
Rewrite rule for nested URL does end in 404
Same Custom Post Type Slug and Custom Taxonomy Slug, with hierarchial unique permalink structure