Skip to main content
added 216 characters in body
Source Link
Sally CJ
  • 39.9k
  • 2
  • 26
  • 48

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?

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).

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?

Source Link
Sally CJ
  • 39.9k
  • 2
  • 26
  • 48

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).