Skip Navigation

[Resolved] Being able to use custom fields from a related custom post in a view's search

This support ticket is created 5 years, 8 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/Karachi (GMT+05:00)

This topic contains 0 replies, has 1 voice.

Last updated by ashiA 5 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1223863

Hi,

Let me first explain the structure of my site, to explain what I am trying to accomplish.
(a) I have a custom post type called INVESTMENT VIEW
(b) This is related to another custom post type called COMPANY.
(c) The COMPANY custom post type has a custom taxonomy called SECTOR attached to it.

For example, Apple could be a COMPANY linked to the Technology Sector. If I were to create an investment view for Apple -- it would be in the custom post type INVESTMENT VIEW, which gets related to the COMPANY - Apple via a post relationship.

What I have done till now, is create a view of the INVESTMENT VIEW post type, that displays information from the related COMPANY post, specifically the company name and the sector. This is easy to do, since while choosing a field in the view output editor, I have the option to do a post selection (for the investment view - company relationship) to show both the company and the associated sector linked to this investment view.

For example, this is the code in the output editor which is correctly displaying the sector for each investment view (i.e. the view is correctly showing the sector of the related company):
[wpv-post-taxonomy type="sector" item="@company-investment-view.parent"]

What I am struggling with, which was quite easy to do in Drupal (via drupal relationships in views) is to pass the SECTOR (that I am displaying correctly) as a parameter for the Custom search in the view. I want to be able to show all investment views linked to a particular sector (via the company relationship). I tried multiple ways, but there does not seem to be an intutive way to get this done.

Any help on the same would be much appreciated.