0

Right now all pages path like /faq/ or /about/. I need path like /home/faq/ /home/about. I tried change url slug in edit page. But Wordpress change my home/faq to home-faq.

I installed plugin Create And Assign Categories For Pages And add custom categories, but paths don't changed.

How can I do this task?

0

1 Answer 1

2

If you want to change the permalink structure for all Pages (i.e. posts of the page type), you can use the WP_Rewrite::$page_structure property like so:

add_action( 'init', 'wpse_382911' );
function wpse_382911() {
    global $wp_rewrite;
    $wp_rewrite->page_structure = 'home/%pagename%';
}

Don't forget to flush the rewrite rules — just visit the permalink settings admin page (wp-admin → Settings → Permalinks).

But if you just want that structure for specific pages, then how about just using the parent-child feature whereby you'd create the home page and make the faq and about pages as children of the home page?

1
  • 1
    Thank you) Parent page is solution. Very simple :)
    – Roman Kh
    Commented Feb 7, 2021 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.