Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Custom Post & Taxo Rewrites WordPress

  • SOLVED

Hi guys,

I have a custom post type "product_info" with a custom taxo "vehicles".

Currently, I can filter posts by /product_info?vehicles=ford

Ideally, I'd like to have a pretty permalink like /product_info/vehicles/ford

Is this possible with custom posts & custom taxos?

Answers (5)

2011-10-25

John Cotton answers:

Add this to your functions.php file, and then re-save your permalinks (Settings > Permalinks)

function my_add_rewrite_rules( $rules ) {
$newrules = array();

$newrules['^product_info/vehicles/(.+?)$'] = 'index.php?vehicles=matches[1]';

return $newrules + $rules;
}
add_action('rewrite_rules_array', 'my_add_rewrite_rules');


2011-10-25

Jim Dugan answers:

I think that's just a matter of setting permalinks to /%postname%/

2011-10-25

Milan Petrovic answers:

Check out my plugin GD Custom Posts and Taxonomies Tools Pro, it supports custom rewrite rules, it supports intersection links (post type archive with one or more taxonomies for filtering) and other things you might find useful:

http://www.dev4press.com/gd-custom-posts-and-taxonomies-tools/

Tutorial with examples:
http://www.dev4press.com/2011/tutorials/plugins/gd-taxonomies-tools/enhanced-custom-post-types-url-rewriting/

Video:
http://www.dev4press.com/2011/tutorials/plugins/gd-taxonomies-tools/custom-permalinks-for-custom-post-types/

2011-10-25

Luis Cordova answers:

yes of course it is possible, it is the default way I think

2011-10-25

Luis Abarca answers:

In this way ??

http://dev.justoalblanco.com/product_info/vehicle/ford/

http://dev.justoalblanco.com/product_info/vehicle/ford/expedition-2011/

Try using this code:
http://pastebin.com/HB37tjaB