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.
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?
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")
Romel Apuya answers:
try reading this.. about [[LINK href="http://winkpress.com/essential/permalinks/"]]custom permalink.[[/LINK]]
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