Cannot use dynamic prefix for WooCommerce permalink
Cannot use dynamic prefix for WooCommerce permalink
Cannot use dynamic prefix for WooCommerce 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’);
add_rewrite_rule doesn’t work when trying to add a new parameter at the end of URL
make a new structure tag that does some processing
I was able to solve it doing these rewrites in the following order. So I specified 3 category url in the beginning then 2 category url below that and in the and single category url /combine/brand/category1/category2/page/1-9/ add_rewrite_rule( ‘^combine/([^/]*)/([^/]*)/([^/]*)/page/([0-9]*)$/’,’index.php?category_name=$matches[1]+$matches[2]+$matches[3]&paged=$matches[4]’, ‘top’ ); /combine/brand/category1/page/1-9 add_rewrite_rule( ‘^combine/([^/]*)/([^/]*)/page/([0-9]*)$’,’index.php?category_name=$matches[1]+$matches[2]&paged=$matches[3]’, ‘top’ ); /combine/brand/category1/ add_rewrite_rule( ‘^combine/([^/]*)/?([^/]*)/([^/]*)/?’,’index.php?category_name=$matches[1]+$matches[2]+$matches[3]’, ‘top’ );
Help with image directory issues on wordpress multisite
Rewrite URLs in a Custom Post Type with Multiple Taxonomies
add_rewrite_rule not working with custom post type
You should use get_query_var rather than $_GET. But you will need to register you custom variables, for instance: add_filter(‘query_vars’, ‘register_my_query_vars’ ); function register_my_query_vars( $qvars ){ //Add these query variables $qvars[] = ‘video_id’; $qvars[] = ‘vide_title’; $qvars[] = ‘venue_src’; return $qvars; } Then you should be able to use get_query_var(‘venue_id’).
Set your taxonomy slug to taxonomy_name and in your post type set the slug to taxonomy_name/%taxonomy_name_term% and flush rewrite rules (simply by going to permalink settings panel in the admin) And after that WordPress will be able to handle /taxonomy_name/%taxonomy_name_term%/post-name/ URLs. So all that is left to do is tell WordPress what %taxonomy_name_term% means and … Read more