Thread Starter
Ovidiu
(@ovidiu)
I’ve worked out how to do it for the custom post type but not for the custom taxonomy.
according to theory it should work just the same but it won’t let me input food/ingredient it keeps stripping away the / which works for food/recipe 🙁
Rewriting and permalinks have nothing to do with my plugin. WordPress is generating rewrite rules. The only way I see to do this is to overwrite existing WP rules for the specific taxonomy and insert additional element in the URL.
Thread Starter
Ovidiu
(@ovidiu)
Using your plugin, I created a custom post type called recipe and chose this Rewrite Slug: food/recipe
according to the codex page: http://codex.wordpress.org/Custom_Post_Types it seems it does this:
'rewrite' => array('slug' => 'food/recipe')
works perfect!
Using your plugin I created a custom taxonomy called ingredients and where it say: Rewrite: I chose custom with this value: food/ingredient instead of the default: Yes, using name.
I checked the codex: http://codex.wordpress.org/Function_Reference/register_taxonomy and it seems like I could use this:
'rewrite' => array( 'slug' => 'food/ingredient' ),
but it doesn’t work. the codex says:
rewrite
(boolean or array) (optional) Set to false to prevent rewrite, or array to customize customize query var. Default will use $taxonomy as query var
Default: true
$args array
* ‘slug’ – prepend posts with this slug – defaults to taxonomy’s name
* ‘with_front’ – allowing permalinks to be prepended with front base – defaults to true
Now I am a beginner with this while you are a developer so my question is am I reading this wrong? Isn’t it possible?
If it should be is it a shortcoming of your plugin or a WP bug?
You say rewriting has nothing to do with your plugin but when your plugin registers a custom taxonomy for me I can set up these options 🙂
I am not interested in custom permalinks or such (I know there is another plugin out there for this)
Thanks for your feedback, maybe you can shed some more light onto this issue please.
To be honest, I had no idea that you can specify rewrite for custom post type using two elements. Good tip. And you are right, taxonomies also support this, I tested it just now. But there is a bug in my plugin that is preventing custom slug to be saved with / character. This is from the old code used in WP 2.9 where custom slug had to be sanitized and such construct was not allowed.
Anyway, new versions of both Pro and Lite editions of plugin will be released tomorrow evening.
Thanks for reporting this bug.
Milan
Thread Starter
Ovidiu
(@ovidiu)
No harm done.
I will wait for the update.
I am no coder, sometimes I misread technical documentation. That’s why I asked for your opinion.
I could manually add my custom stuff to my functions.php but for what I am doing currently, your plugin just makes life easier.
Thanks for looking into this!
I hate adding anything to functions.php. After a while you forget the things you add, and when you need to change the theme it’s a real mess. For most things, plugins are best solutions.
Anyway, issue is fixed, and new version will be released later tonight.