Skip Navigation

[Resolved] Nested URL for Custom Posts and Archive

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 2 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#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 hidden 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? hidden link password: potential

#2431017

Minesh
Supporter

Languages: English (English )

Timezone: 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
=> hidden 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
Supporter

Languages: English (English )

Timezone: 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:
=> hidden link

does that helps?