I need to rewrite the permalink structure for my Custom

Hi

I need to rewrite the permalink structure for my Custom Post Types as created by CustomPress. The plugin offers a 'Rewrite' option in the post type and on taxonomies, but if I insert for example:-

/%category%/

As the prepend, or

/%category%/%servicetype%/

.. which includes my taxonomy it enters into the permalink as clear text exactly as the above i.e. with %name% in the URL. Give this is a permalink rewrite then I would have thought it supported standard permalink formats?

Regards
Glennyboy

  • glennyboy

    Hi

    Mmmm...

    I have achieved what I was looking for, but I feel it's a bit of a hack that requires the following plugin:-

    Custom Post Type Permalinks

    I'm not sure why it require the plugin as I'm not actually entering my required permalink structure in it, but if I deactivate then it doesn't work - bit weird.

    OK so what I have is the plugin above plus my taxonomy term entered as '%servicetypes%' in the Custom Slug of the Custom Post Type which is 'Services'. This gives me the required permalink structure of:-

    /'%servicetypes%'/%postname%/

    The reason I need this is that I want to call my Custom Post Type 'services' but I don't actually want to show 'services in the URL/permalink structure as it would by default. 'Services' adds no SEO benefit to the URL.

    ie not. /services/test-service/ but rather /test/test-service/ ? (where 'test' is my test taxonomy and 'test-service' is the post name)

    If there is a way to actually avoid the Custom Post Type default slug and prepend a taxonomy directly in Custom Press I'd love to know as I don't want to rely on more than one plugin to achieve what I am looking for.

    Thanks

    Glennyboy

  • Arnold

    The %xxx% style permalinks ONLY work for "post" type posts. They do not appy to custom post types.

    The rewrite slug in your custom type definition is the actual slug that will be used in the permalink. So if your custom type name is "service", if you put in there "test" then the permalink would show "test" But it is NOT a variable as you seem to want this to display your taxonomy rather than your post type. This is the slug used for single posts usually followed by the postname. /service/my-service-offer/

    The has archive field controls the slug used for archive pages. It s usually plural because it for multiple posts. So rewrite slug /service/ , has_archive slug /services/

    Taxonomies has the same structure and works the same way. So if you had a "test" taxonomy with no change to the slug you would address it as /test/term/ where "term" is one of your taxonomy values as entered in it's editor, like categories or tags.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.