How can I remove parent slug from child page’s permalink? This may not be Atahualpa specific, but I can’t figure out how to do it… Perhaps there is a plugin that might work?
I use pages (i.e. not posts) that are setup as children of a parent page. In my menu bar navigation they appear as:
/services/page1.html
/services/page2.html
/services/page3.html
Where what I want is:
/page1.html
/page2.html
/page3.html
(I’m using the “html-on-pages” plugin to add the .html since I’m moving this site over from another server and this is the site structure it currently has.)
Is there any way to accomplish what I’m looking to do?
Add this to your functions.php
Try this Custom Permalinks plugin. This may help you.
Maybe Custom Permalinks plugin might help you.
The plugin sets custom permalinks on a per-post, per-tag or per-category basis.
It doesn’t solve the issue of removing a parent slug from the URL, but it might solve the issue you have. It would require you to alter your theme and to utilize WordPress’ native menu builder.
Create all your pages as normal, with the exception of nesting them under parents. Then create a new menu (Appearance > Menus) and add the “parent” pages. Using the menu builder, you can make top level pages appear nested under these “parent” pages. Once it’s all done, set this menu as your primary menu. (this is all intuitive once you’re on this menu builder page)
Lastly you would need to alter your theme to remove the name menu that it’s using (likely
wp_list_pages
or something of the like) and the instead call in your new primary menu. You might use this code to call in that new menu:Here’s a more complete guide on accomplishing this.
FWIW, I’m trying to remove the parent slug from the url for a custom post type, so if you did, by chance, figure it out, please let me know. I’d be interested to see what you did to get this accomplished.
If someone needs a different hint:
If you want dropdown navigation menus using PARENT pages, then create a menu from admin dashboard, where you will set the dropdown menus using the PARENT PAGES.