Skip Navigation

[Resolved] Custom query for post reference field

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

Problem:

How to customize SQL query for post reference field to be able to display what specific post title that is connected to the custom post type?

Solution:

We don't provide the customize SQL query support, you can try the solution here:
https://toolset.com/forums/topic/custom-query-for-post-reference-field/#post-921113

Relevant Documentation:

https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/

This support ticket is created 6 years, 5 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Zoren_LeoL6293 6 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#920841

I just wanna ask if how to customize SQL query for post reference field to be able to display what specific post title that is connected to the custom post type?

Regards

#921113

Hello,

We don't provide the customize SQL query support, I suggest you try these:
1) Create a view or shortcodes to retrieve the related posts
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/

2) Use Post relationship API to retrieve the related posts in your website
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post_types

3) Dashboard-> Toolset-> Settings-> Front-end Content
Enable option "Enable Views debug mode", and option "Full debug mode",
Run those page/post of step1) and 2), then you will be able to get those SQL query in details.

And you can also install other plugins to get the SQL query details, for example:
https://wordpress.org/plugins/search/query+monitor/

#921119

I see, okay thanks!