Skip Navigation

[Resolved] Show posts in a view based on a specific custom field which is used as a tag

This support ticket is created 5 years, 7 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 1 reply, has 2 voices.

Last updated by Luo Yang 5 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1291055

I have a post type called airport. Every airport has a code which is saved as custom field. I use the same code as a tag for the blog section when the blog post is about that airport. Can I create a view for the airport that shows the posts about that airport based on the code?

#1291367

Hello,

I think it is possible within Toolset plugins, for example:
In single blog post, you can create a nested view:
1) Parent taxonomy view:
- Query terms of taxonomy tag
- filter by:
Taxonomy is set by the page where this View is inserted
- in View's loop, display below child post view shortcode, and pass term's title value as shortcode attribute "airportcode", like this:
[wpv-view name="CHILD-POST-VIEW-SLUG" airportcode="[wpv-taxonomy-title]"]

2) Child post view:
- Query airport posts
- filter by:
Select items with field:
wpcf-code is a string equal to VIEW_PARAM(airportcode)
- in view's loop, display airport post in formation.

More help:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/