Skip Navigation

[Resolved] Custom URL slug format for Custom Post Type

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to know the purpose of the rewrite option on their CPT settings.

Solution:
For more information on this I would recommend checking here.
https://toolset.com/documentation/user-guides/create-a-custom-post-type/#even-more-advanced-custom-post-types-settings

This support ticket is created 5 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 8 replies, has 2 voices.

Last updated by Ben 5 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#1190603

Ben

Can I see up Custom URL slug formats for Custom Post Types?

I can see the "Rewrite" option but I cannot find any further documentation other than what is here (https://toolset.com/documentation/user-guides/create-a-custom-post-type/).

#1190678

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ben,

When you say custom slug format what are you referring to ?

Please provide an example.

Thanks,
Shane

#1190686

Ben

Hello Shane,

I am referring to something like the following.

Imagine a Custom Post Type of "Fruits" that would normally display as: mydomain.com/fruit/TITLE

Is there any way to change this to give something like: mydomain.com/fruit/POSTAUTHOR-TITLE/ or mydomain.com/fruit/CONNECTEDPOSTVIARELATIONSHIP-TITLE/ ?

I hope the above makes some sort of sense?

#1190747

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ben,

Unfortunately not this isn't possible unless some custom coding is used. The rewrite exists so that you can change the default slug to any that you choose.

Thanks,
Shane

#1191081

Ben

Thank you for confirming that Shane.

What do you mean "change the default slug"? I am not sure I understand what you mean.

#1191091

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ben,

Lets say you have a cpt called Cat and the slug for that cpt is cat. With this setting you can overwrite that slug and put dog

So on the frontend instead of example.com/cat/macy you will have example.com/dog/macy
Please let me know if this helps.

Thanks,
Shane

#1191136

Ben

Ah, I see. Thank you Shane that makes more sense.

Why would this be used though? When the CPT slug can be changed in the options.

#1191169

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ben,

Not sure why you would need this either. However you can add the author in the slug with the wordpress default permalink settings but it will be applied for every post.

Thanks.
Shane

#1191236

Ben

Thank you very much for all your help with this Shane!