Layout Builder - Condition - Child Post

In the layout builder, I am unable to find the condition where I can specify Post_type > Child post?

Current structure of website is like this:

Custom post type - Explore the guide - archive

  • Parent Post
    – Child post > here is the problem I cannot specify layout builder condition > not sure how to target

Hi @pavlito,

Thanks for reaching out.
There is no such option available in the condition to specify the Post Type > Child Post. If you select the Child Post as the Specific Post condition it will be automatically applied with the Post Type too.
If that is not what you are looking for, please elaborate on your problem a little more.

Thanks

I cannot use exact post id to set condition because I might have 100 posts with different ids.

Here is the explanation

Hi @pavlito,

If you want to use a different layout for a specific post, you need to specify the Post Name not the ID. You can also use the Parent condition to specify the Layout will only work when the Post having the specified parent.

Hope it helps.
Thanks

Hi @tristup

When I say specific post I don’t mean on the only one specific exact post.

To be more clear:
I have 2 types of posts Parent and Child posts. I need to be able to set layout for Child type of post, but I cannot do that using Conditions from the Cornerstone, because there is no such an option? Currently the problem is what I have created for Parent Post reflects on the Child type of post, without ability to separate using conditions.

Hi @pavlito,

If you use the Parent condition then the condition will be applicable to the Child of the specified Parent, if you want to add a few more Parent you can add by clicking on the Add Condition Group. In that way, you can add multiple Parents of the Child for which the layout will be applicable.
As an example, if a Sample Post has a Sample Child Post, then the condition will the Parent is Sample Post in that way layout will be applicable only to the Sample Child Post.

Please remember that there is no condition available to check if the Post or Page is a Child of other Post or **Page.

Thanks

Hi,

This is understood. But there is one problem.
How can I say in the condition if any parent exists (not only the specific one ) ?

Hello @pavlito,

Please be advised that the Parent-Child relationship only applies to pages. You can check it here:

From what I have understood, you are trying to use Post Type > Post item and you have a custom post type as well. What you need is Custom Post Type > Custom Post Item. To translate this into a condition, you will use the “Post Type is {Custom Post Type}” and if I base the screenshot, you need something like this:

This element condition will only display if the current post type is “Guide”. I am just want to make sure that I am advising the correct custom post type. If you would allow us to log in to your site, that would be great so we can check your custom post types and your element settings. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
- Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

Best Regards.

Secure note added.

Hey Pavlito,

You can use two conditions.

Post Type is Guide AND Guide Category is Subchapter

Post Type is Guide AND Guide Parent is {parent post name}

And also take notes of the priority numbers of each layout.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.