Skip Navigation

[Resolved] Types and related post with YARPP (with multiple cpt)

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to include support for multiple custom post types in YARPP, but the code in another ticket only provides support for one type: https://toolset.com/forums/topic/getting-types-to-work-with-yarpp/

Solution: Add a comma-separated list of cpt slugs here:

...
if(in_array($post_type, array(
    'my-post-type', 'my-other-post-type', 'my-other-other-post-type'
...
This support ticket is created 6 years, 9 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by ritaV 6 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#616717

i read https://toolset.com/forums/topic/getting-types-to-work-with-yarpp/

but if i have multiple cpt: films, directors and actors..
- film with slug "film"
- director with slug "regista-coreano"
- actor with slug: "attore-coreano"

What should I insert in my file function?
i have multiple slug....

#617162

Hi, it looks like you can add a comma-separated list of post type slugs like this:

...
if(in_array($post_type, array(
    'my-post-type', 'my-other-post-type', 'my-other-other-post-type'
...
#617208

Easy! Php basic! Thank you so Much Christian!