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

Taxonomy & Post Type Permalinks WordPress

  • REFUNDED

I'm working on a website that will have a catalog of guitar effects pedals.

I have made a custom post type called "Pedals". A hierarchal taxonomy called "Manufacturers" and a non-hierarchal taxonomy called "Types".

I would like the permalink structure to look like this

website.com/pedals - lists all pedals from the "Pedals" post type
website.com/pedals/[manufacturer] - lists all pedals in the specified manufacturer taxonomy (category)
website.com/pedals/[manufacturer]/[pedal] - displays the single.php for a particular pedal. [manufacturer] is obviously the manufacturer taxonomy (category) it belongs to.
website.com/pedals/[type] - lists all pedals with the specified type taxonomy (tag)
website.com/pedals/[manufacturer]/[type] - lists all pedals by the manufacturer of that type

I don't want website.com/pedal/[pedal], website.com/[pedal], website.com/[manufacturer], or so forth to be valid URLs. Everything should have /pedals in front of it, and then it should nest accordingly.

Thanks in advance.

Answers (4)

2011-07-17

Svilen Popov answers:

Try the [[LINK href="http://wordpress.org/extend/plugins/custom-permalinks/"]]Custom Permalinks[[/LINK]]


Dan Davies comments:

Wouldn't that involve manually setting a permalink for each pedal? And continuing to do that forever?

2011-07-17

Ryan Riatno answers:

Have you assign the "Manufacturers" and "Types" taxonomy on custom post type "pedals" ?


Dan Davies comments:

I've done this, if this is what you mean:


register_taxonomy("db_manufacturers", array("db_pedals")
register_taxonomy("db_types", array("db_pedals")

2011-07-17

Romel Apuya answers:

try reading this.. about [[LINK href="http://winkpress.com/essential/permalinks/"]]custom permalink.[[/LINK]]

2011-07-19

Gabriel Reguly answers:

Hi Dan,

How are you dealing with these permalinks?

Have you tried to use a template redirect?


add_action( 'template_redirect', 'custom_template_redirect' );
function custom_template_redirect() {
global $post;
if ( $post->post_type == 'pedals' ) {
// here you add your code to get the correct page
}
}


If you provide the code for your custom post type and the taxonomies I could help more.

Regards,
Gabriel


Dan Davies comments:

Hey Gabriel.

The code for my post type and taxonomies is here: http://pastebin.com/3CiyzdiJ

All the best.

Dan