Navigation überspringen

[Gelöst] How to add directory to WordPress default post URLs without affecting CPT slugs

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem: I would like to add a directory to the URL of default posts without affecting CPT URL structures. If I add the directory in a custom permalink structure in Settings > Permalinks, the directory is added to all posts including CPTs. I just want it added to standard posts.

Solution: Add the directory in Settings > Permalinks as a custom directory structure, then edit each CPT and turn off the option "Allow permalinks to be prepended with front base"

This support ticket is created vor 6 Jahren. 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von leilaG vor 6 Jahren.

Assistiert von: Christian Cox.

Author
Artikel
#1197440

Hi, how do we change the slug for the default wordpress posts without affecting CPT slugs.

For example we would like the wordpress default slug to be news/post-name

If we change this in permalink settings it adds /news to our custom post types
/news/company/post-name
/news/job/post-name

#1197525
Screen Shot 2019-02-07 at 3.21.19 PM.png

In the Post Type editor, there is an option "Allow permalinks to be prepended with front base". Try turning that off for your custom post types, and add "blog" to the beginning of your custom permalink structure in Settings > Permalinks.

#1197775

That worked 🙂 Thanks Christian.