Eliminar la base de taxonomía personalizada de Wordpress

I am using custom taxonomies with WordPress 3.0.4

Does anyone how to remove the taxonomy base from the URL?

I have seen plugins that do it for categories and tags, but not for custom taxonomies.

For example, I have a custom taxonomy called 'cities'. I would like my URL structure to be mydomain.com/newyork instead of mydomain.com/cities/newyork

Is there a function or something I can use?

preguntado el 08 de enero de 11 a las 22:01

2 Respuestas

http://codex.wordpress.org/Function_Reference/register_taxonomy

If you look there, you'll see a 'rewrite' argument which you can see to true. This argument also takes an argument of 'with_front' which defaults to true... which is why you have the 'front' of the taxonomy.

When creating your custom taxonomy, set those arguments as you wish, and you'll be away :)

Si esto es who has set up this custom taxonomy, then you're able to actually set the with_front argument to false which will stop this happening. If you look here:

http://codex.wordpress.org/Function_Reference/register_taxonomy

You'll see the 'rewrite' argument and just below that, you'll see the 'with_front' part.

Respondido el 11 de enero de 11 a las 14:01

I am also looking for an answer to this. Unfortunately, with_front => false does not remove the taxonomy base. If I use slug => false I get the desired result, BUT it breaks all other permalinks. - Astrotim

@iamfriendly and @Carson - setting the with_front argument to false (or true for that matter) will not allow you to remove 'cities' from the URL.

respondido 06 nov., 12:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.