Taxonomy Url with Custom post type prefix re-write rule

Try changing the $args you are passing into the register_taxonomy method so that rewrite -> slug includes the development tag $args = array( ‘labels’ => $labels, ‘public’ => true, ‘show_in_nav_menus’ => false, ‘show_ui’ => true, ‘hierarchical’ => true, ‘supports’ => array(‘title’, ‘editor’, ‘excerpt’, ‘thumbnail’), ‘rewrite’ => array(‘slug’ => ‘development/section’, ‘with_front’ => true, ‘hierarchical’ => true), … Read more

Permalinks, Rewrites, Get Variables, Oh My!

I’m not sure but I think that you just need to add two query vars, “group” and “value”, not two rewrite tags. Can you try this: add_filter(‘query_vars’, ‘cyb_add_query_vars’); function cyb_add_query_vars( $vars) { $vars[] = “group”; // name of the var as seen in the query string and URL $vars[] = “value”; return $vars; } add_action(‘init’,’cyb_add_rewrite_rules’); … Read more

Multiple values in a rewrite rule, is it possible?

As far I understand, you know are able to have an URL like example.com/recipes/dinner/ or example.com/recipes/lunch/ but now you also want to have an URL like example.com/recipes/dinner-lunch/ that pulls posts from both “dinner” and “lunch” courses. In currents state of WP rewrites this is not possible just with add_rewrite_rule but you also need to use … Read more

Redirect taxonomy to custom template to list terms in taxonomy

The 404 might be created because your regular expression requires the value after ‘state/’. Please try to replace: function handle_taxonomy_route() { add_rewrite_rule(‘^state/([^/]+)/?’, ‘index.php?state_var=$matches[1]’, ‘top’); } with: function handle_taxonomy_route() { add_rewrite_rule(‘^state/([^/]*)/?’, ‘index.php?state_var=$matches[1]’, ‘top’); }

why is are these rewrite_tags and rules not working?

Your rewriterules arn’t correct anymore. You changed add_rewrite_rule(‘^video/([^/]*)/([^/]*)/[^/]*)’, ‘index.php?pagename=video&video_id=$matches[1]&video_src=$matches[2]&video_title=$matches[3]’, ‘top’); To add_rewrite_rule(‘^video/([^/]*)/([^/]*)/[^/]*)’, ‘video/&video_id=$matches[1]&video_src=$matches[2]&video_title=$matches[3]’, ‘bottom’); The correct rewriterules for your pages are: Video add_rewrite_rule(‘^video/([^/]*)/([^/]*)/[^/]*)’, ‘index.php?pagename=video&video_id=$matches[1]&video_src=$matches[2]&video_title=$matches[3]’, ‘top’); Team add_rewrite_rule(‘^videos/team/([^/]*)/([^/]*)’, ‘index.php?pagename=videos&team_id=$matches[1]&team_slug=$matches[2]’, ‘top’); League add_rewrite_rule(‘^videos/league/([^/]*)/([^/]*)’, ‘index.php?pagename=videos&league_id=$matches[1]&league_slug=$matches[2]’, ‘top’); For team and league I assumed your WordPress page is “videos”. If it is the subpage then you have to change “pagename=videos” … Read more

Prettified page URL w/ query var redirects to prettified page URL w/o query var

I think you just have to add kategori to the array of query vars: EDIT- after much iteration we’ve arrived at a solution. the original code seemed to be working, but only with specific permalink settings, as I was mistakenly routing to a post instead of a page. rather than p=, it should be pagename=, … Read more

How to filter custom post type archive by meta value

Like Bainternet said in comments, you’ll need to mess with add_query_var as well as add_rewrite_rule. We usually do something similar to: global $wp; $wp->add_query_var( ‘some_var’ ); add_rewrite_rule( ‘some/path/([^/]+)/?$’, ‘index.php?some_var=$matches[1]’ ); See this WordPress Trac ticket, as well as documentation on add_query_var and add_rewrite_rule