Navigation überspringen

[Gelöst] Slug Problem For Hierarchical Custom Post Types

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

Problem:

When a custom post type is set as hierarchal it is not possible to upload media with the same slug.

Solution:

That is true for all posts and pages in WordPress.

Please avoid uploading images with the same name as the posts slug.

This support ticket is created vor 3 years, 4 months. 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.

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

Zuletzt aktualisiert von fahimS-2 vor 3 years, 3 months.

Assistiert von: Christopher Amirian.

Author
Artikel
#2547067
Screenshot_8.jpg

Tell us what you are trying to do?
First I uploaded an image on my website which has title 'pagescreen' and it's URL is '/pagescreen.jpg'. I created a custom post type called 'Product' and I kept it Hierarchical in the settings. Now I created a Product Post which has title 'pagescreen'. Now I can't set my new post url to 'mydomain.com/product/pagescreen'. It is automatically becoming 'mydomain.com/product/pagescreen-2'. If I visit to 'mydomain.com/product/pagescreen', the image 'pagescreen.jpg' appears.

If I don't keep the post hierarchical, everything works fine. But I want to keep the post hierarchical.

#2548259

Christopher Amirian
Unterstützer

Sprachen: Englisch (English )

Hi there,

I replicated the behavior on a clean installation and I am not sure if it is expected or not.

I reported this to second-tier support and will get back to you as soon as I have an answer.

Thank you.

#2549519

Christopher Amirian
Unterstützer

Sprachen: Englisch (English )

Hi there,

I have an answer from the second tier.

This is not related to Toolset and it is a main WordPress thing. Even if you deactivate Toolset altogether and test that for pages (which is default WordPress but it has that hierarchy option) you will see the same thing.

In general, please keep all the slugs unique and avoid uploading images with the same name of the page or custom post type slugs.

Thanks.

#2549669

My issue is resolved now. Thank you!