Skip Navigation

[Resolved] Displaying Related Child Posts is not working with 3rd party themes

This support ticket is created 6 years, 1 month 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nigel 6 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1131821

I am trying to:
I set up my system to display Related child posts for products according to your page: "Displaying Related Child Posts" at https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/

It works great with Toolset Starter Theme! Since you do not support this theme any more I am trying to switch to a 3d party theme. I have tried to activate Astra, OceanWP, TwentySixteen, TwentySeventeen and all these themes break the above functionality.

FYI: The relationship is one-to-many Designs(one) --> Products(many)

Can you please take a look? Toolset starter theme is active now. Related child posts show on this simple template I set up for products: hidden link

Activate any of the other installed themes and see the functionality disappear from the product page above.

You can log in with the details supplied.

Thank you!

Vic Spies

#1132029

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Vic

I'm just looking into this. It certainly shouldn't have anything to do with whether you use Toolset Starter or another theme.

I'll check your site and update you.

#1132031

It's weird that this functionality only works with Toolset Starter Theme.

Yes please have a look and let me know what you find out.

Really appreciate it!

#1132624

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Vic

I did some more testing, and the issue appears to be when trying to display sibling posts when using Layouts.

The documentation itself is unclear on this (well, it is not possible to follow the exact steps if you are using Layouts).

When implementing it with Views only (not Layouts) it works fine.

When implementing it with Layouts (ignoring some of the limitations of the documentation) it simply doesn't work, the View to display the child posts doesn't show them.

Except! Oddly enough, it does in our retired Toolset Starter Theme, but not in standard themes such as twentyseventeen.

Also, this is only a problem where you are outputting sibling products. It works correctly with other post types, even when using Layouts.

So I'm escalating this Layouts issue (and also asking for the documentation to be updated), and I'll keep you posted.

In the meantime, you might want to not use Layouts for the product template and use Views alone.

#1134176

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Vic

We'll need to fix this issue with using Layouts to display sibling WooCommerce products, but for now the following will work (with any theme).

1. create the View to display sibling products which has the Query Filter to specify the parent is the current post in the loop. In this case, you need to design the View output directly in the Loop Editor (i.e. in between the wpv-loop tags), you cannot link to a content template.
2. insert this View into an unassigned Content Template which will be used to set the parent context
3. insert this template into your Layout assigned to single products. You need to insert the template using the wpv-post-body shortcode in a Visual Editor cell, but, you must also add the attribute suppress_filters="true" to the wpv-post-body shortcode.