Detect if 1st, 2nd or 3rd level custom page?
You can call https://codex.wordpress.org/Function_Reference/get_ancestors within your template. It’ll return an array of ancestors to your current post and you can use the length of the array to see how deep you are in your hierarchy. Use it at the top of your template file to set a variable $post_depth and use that to adjust your … Read more