Navigation überspringen

[Gelöst] Nested URL for Custom Posts and Archive

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

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

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

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

Zuletzt aktualisiert von Minesh vor 3 years, 10 months.

Assistiert von: Minesh.

Author
Artikel
#2430727

Tell us what you are trying to do? Change the url for custom posts and archive pages

Is there a similar example that we can see? I need the url for archive pages and posts to be versteckter Link

I am able to change the /habitat/ part, but can I change it so that it's nested under /learning/?

What is the link to your site? versteckter Link password: potential

#2431017

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Toolset offers limited URL rewrite feature. You can rewrite the single custom post URL as /learning/habitat
=> versteckter Link
(with the screenshot "student" is the post type slug)

for archive its not possible, maybe you can use the rewrite URL plugin that offers such feature or you can add the custom code as mentioned with the following link:
=> https://stackoverflow.com/questions/24136413/wordpress-changing-a-custom-post-type-archive-link

#2432587

Thank you. All the documentation I'm finding says to use register_post_type and modifying the url there, but this is an existing post type. How do I do that with an existing post type? Should I use get_post_type_archive_link( 'habitat-hub' ) and rewrite from there?

#2433475

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

The function get_post_type_archive_link() is used to get the post type archive link:
- https://developer.wordpress.org/reference/functions/get_post_type_archive_link/

*** Please make a FULL BACKUP of your database and website.***

What if you edit your post type "habitat" from:
=> Toolset => Post Types => Edit your post type "habitat" and under the section "Options" navigate to "has_archive" option and in the textbox you should try to add "learning/habitat" and save the post type.

Then go to: Settings => Permalinks and click on button "save changes" and then try to visit the URL:
=> versteckter Link

does that helps?