Pagination of a WP_Query Loop in a child-page page template

Glad that you managed to figure out a solution, which yes, does work. But you could make it more selectively, i.e. target just the specific pages, by using is_single( ‘<parent slug>/<child slug>’ ), e.g. is_single( ‘family-law/success-stories’ ) in your case. Secondly, it’s not exactly the redirect_canonical hook which caused the (301) redirect on singular paginated … Read more

Load child template based on parent

Instead of putting something on the template, you can keep templates clean and add to functions.php a function that use ‘template_include’ action hook to check parent page template and return same template for children pages. add_action(‘template_include’, ‘auto_child_template’); function auto_child_template( $template=”” ) { if ( ! is_page() ) { return $template; } else { $page = … Read more

WordPress pages with hierarchy

If I read your question correctly you just need to set the ‘about’ page as a parent to ‘contact’ and ‘opening hours’ then the permalink will be how you want it. To do this go edit page of ‘contact’ and in the page attributes box set the parent to ‘about’ page.

Custom page slug without creating a WP page

You’re close, the query var for passing page slug is pagename: add_filter(‘query_vars’, ‘add_account_edit_var’, 0, 1); function add_account_edit_var($vars){ $vars[] = ‘account-edit’; return $vars; } add_action( ‘init’, ‘add_account_edit_rule’ ); function add_account_edit_rule() { add_rewrite_rule( ‘^my-account/([^/]*)/?’, ‘index.php?pagename=my-account&account-edit’, ‘top’ ); } To capture the value in your rule, you need to pass the value in $matches[1]: add_rewrite_rule( ‘^my-account/([^/]*)/?’, ‘index.php?pagename=my-account&account-edit=$matches[1]’, ‘top’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)