Closed bobbingwide closed 4 years ago
There is another assumption that I should point out. While wp_list_pages
does appear to support multiple post types, by passing the post type of the parent post we're limiting ourselves to only finding posts of that type.
Therefore this block will not work where the post hierarchy allows different different post types in the parent-child hierarchy.
Note: I've never worked on a WordPress site where child posts can have a different post type from their parent.
When I tried to use the sb-children-block to list the variations of my
block
CPT nothing was returned. I'd assumed that the logic usingchild_of
would not require thepost_type
parameter. But that assumption was wrong. The logic needs to find thepost_type
of the selected parent post ($post
) and pass that on the call towp_list_pages
.