Skip Navigation

[Resolved] I'm calling all the child and making them use their parent Id to view the data

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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 3 replies, has 2 voices.

Last updated by Shane 7 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#433442
Screen Shot 2016-09-07 at 2.01.51 AM.png
Screen Shot 2016-09-07 at 1.05.31 AM.png

I am trying to: call them at a one place instead of doing for each separately, I'll attached a screenshot of all three child relation code.

I wanted to get them sorted by published which is being impossible at the moment. If I can call all the child relation at the same time then it will be easy to sort them by published date

Also attaching a screenshot of output

#433666

Shane
Supporter

Languages: English (English )

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

Hi Laura,

Thank you for contacting our support forum.

I'm assuming that the parents of the 2 code blocks are of different custom post types correct?

If so then you are not able to combine them.

Thanks,
Shane

#433848

Hi Share, Hope I can explain you

so I'm using many to many relation

case PT is realted to Case Order PT and Notice of hearing PT

in the code screen shot I'm using Case Order and Case relation PT which is case-order-rel
exact same thing with Notice of hearing

Everything works fine it's just I need to make them sorted by published date and if people will choose more than one relation for each post type only the latest should come at the top.

I think there should be a way to such a thing.

Any kind of help will be great.

#434132

Shane
Supporter

Languages: English (English )

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

Hi Laura,

You can actually retrieve them from the database by using the WP_Query function.

The parent information is actually stored in a hidden custom field call "_wpcf_belongs_{cpt-slug}_id" . This custom field actually stores the id of the parent post. So you can actually query the database directly for the items you want https://codex.wordpress.org/Class_Reference/WP_Query

Please let me know if this helps.
Thanks,
Shane

The forum ‘Types Community Support’ is closed to new topics and replies.

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