2

I am seeking some help with Custom Post Types using Advanced Custom Fields Pro.

I have created a Custom Post Type (headphones) and enabled "Hierarchical" as explained here: https://www.advancedcustomfields.com/resources/registering-a-custom-post-type/.

I have also created a "Headphones" Page with the URL website.com/headphones/. When I create a new "Headphones" post for "Sony XM5" as an example, the URL is website.com/headphones/sony-xm5/. This is correct as the parent Page is website.com/headphones/.

What I would like to do is create a child post under website.com/headphones/sony-xm5/ so that if I create a post about "Sony XM5 Maintenance", then the URL would be website.com/ headphones/sony-xm5/maintenance/.

When I create a new Post, I don’t see an option to select a parent Post which exists if I create a Page. How do I achieve the above so that there is a hierarchy within the Custom Post Type which I enabled when creating the CPT using ACF?

Note, I am not using categories or taxonomies.

Thank you

1 Answer 1

4

In case you haven't resolved this on your own yet, I just experienced this exact same issue, and realized the solution is that I had not enabled Page Attributes for my custom post type. In this case, I'm working with a custom post type called "Industries." So, first I went into the ACF Custom Posts menu, and on the edit page for my 'industry' post type, under the Advanced Settings section, General tab, check the box next to "Page Attributes" as shown here:

screenshot of the backend of ACF's Custom Post Type > Advanced Settings > General Tab

This will then display the Page Attributes box, which contains the parent page select dropdown field, in the right sidebar of your individual custom posts of this type, as shown here:

Screenshot of the Page Attributes box in the backend of an ACF custom post

1
  • 1
    Thank you Troy! This was the solution!
    – Bec
    Commented Oct 16, 2023 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.