Add theme templates for child categories into the template hierarchy

Don’t use template_redirect to load alternate templates as you can break any functionality that uses this hook to run on a lower priority than yours. The right hook is template_include. This is according to Mark Jaquith, one of the WP lead developers. https://markjaquith.wordpress.com/2014/02/19/template_redirect-is-not-for-loading-templates/ That said, it might be more appropriate to use the category_template filter … Read more

select a private page as parent for another private page

The following conditions is assumed to make it working Classic Editor is in use, since Gutenberg/Block Editor is rendered by Javascript, it requires another solutions and so far I am not sure if there is override option yet. For the code you have shown, it does not work because the number of arguments for add_filter() … Read more

Page as a child of a Custom Post Type

When you register the post type you can set hierarchical to true. hierarchical (boolean) (optional) Whether the post type is hierarchical (e.g. page). Allows Parent to be specified. The ‘supports’ parameter should contain ‘page-attributes’ to show the parent select box on the editor page. Default: false Note: this parameter was planned for Pages. Be careful, … Read more