How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only

Is there a way to limit the creation of pages (custom post type) to a specific depth – e.g. level 1 (where 0 = parent, 1 = child, 2 = grand-child, etc.)? For example, let’s create a ‘Summer’ recipe page (custom post type: Recipe) with a slug ‘/summer’. Let’s now create a ‘Pie’ page (a … Read more

Can I have two child pages of different parents with the same name?

I have two pages – new.hillsong.com/australia/sisterhood – new.hillsong.com/hills/sisterhood Both pages are displaying the content for the /hills/sisterhood site but they are different pages with different content. I can’t seem to find anything online about this. Is this possible? Are there any ways to make this work. Thanks for the help! Paul 4 s 4 Yes, … Read more

A check for if is parent page, if has children, if has grandchildren

I have one default page template that I wish to use for two scenarios. I’d prefer to use only one page template for the sake of simplicity for my client. Here’s what I’m trying to accomplish: if parent_page OR if child-page without children { display full-width-layout } if child page with children or if grandchild … Read more

Check if is on child-page of a particular page

I am trying to output a logo depending on which page is being viewed. <?php if ( is_page(‘home’) || is_page(‘services’) ) { ?> <div class=”col-md-2 col-sm-4″> <?php ci_e_logo(‘<h1 class=”logo ‘ . get_logo_class() . ‘”>’, ‘</h1>’); ?> </div> <?php } else { ?> <div class=”col-md-2 col-sm-4″> <h1 class=”logo imglogo”> <a href=”http://websiteaddress.com”> <img src=”<?php echo get_bloginfo(‘template_directory’);?>/images/picturehere.png” alt=”title … Read more

Get parent page url to show up when it is in child pages

I would like to ask that, how to get the link back to parent page when i’m in the child pages? I would rather to use a proper link instead of <a href=”https://wordpress.stackexchange.com/questions/192895/javascript:history.back()”>Go Back</a> method. Question & Example: How can i get the link of 2nd level child page when i’m in 3rd level child … Read more