Skip Navigation

[Resolved] adding parent and child options to Yoast custom post type

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 3 voices.

Last updated by joshS-5 5 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#880811
Screen Shot 2018-05-13 at 11.16.32 AM.png
Screen Shot 2018-05-13 at 11.16.45 AM.png

Tell us what you are trying to do? I'm trying to add parent/child option to custom post type created by Yoast Local when you have multiple locations.

Is there any documentation that you are following? I've tried different things I've found on the web, CPT UI, and the following code:

function bis_change_registered_post_type_args($args, $post_type) {
if($post_type == 'wpseo_locations') {
$args['hierarchical'] = true;
$args['supports']['page-attributes'] = true;
}

return $args;
}
add_filter('register_post_type_args', 'bis_change_registered_post_type_args', 99, 2);

Is there a similar example that we can see?

What is the link to your site? hidden link

Thank you.

#881382

Hi, I'm not very familiar with Yoast Local, but if their post type is public then you should be able to go to Toolset > Post Types, edit the post type, and set hierarchical property there. However, some plugins create their own custom post types that are private, and Toolset does not support modifying those post types. I think the Yoast Local support team is the best source of information about this.

$args['hierarchical'] = true;

Keep in mind that parent / child post relationships in Toolset are not the same as hierarchical post types. Toolset relationships are between different post types. Hierarchical relationships are between posts in the same post type, like Pages in WordPress.

#883555

Thanks for your reply and yes this one seems tricky. I've reached out to Yoast for help too thanks!

#889143

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Josh,

As Christian is currently on vacation I will be handling this ticket.

Is there any update on this from the Yoast team ?

Please let me know.

Thanks,
Shane

#889152

Yoast actually said this was not possible to do, but a developer of a permalinks plugin I'm using did create a solution. The solution works for both the url and the breadcrumbs. I'm happy to reference him if you like.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.