Skip Navigation

[Resolved] Taxonomy view filtering

This support ticket is created 5 years, 10 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
- 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)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by bobA-2 5 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1208966

1. Say I have a Custom post type sportsevents
2. I have a custom taxonomy with tv channels

So each sportevent has a tv channel taxonomy term

Now I make a taxonomy view with tv channels and a sportevents view with Select posts with taxonomy: tv-channels set by the parent Taxonomy View. And I set event time custom field to: is a number between TODAY(), FUTURE_DAY(1).
So I do the Post View inside a Taxonomy View

I get sportevents grouped by tv channel for today and that is great. But some tv channels will not be in use every day but they stil show up in the view output with No results found message which I could remove of course.

But is it somehow possible to contruct something so I can get a taxonomy view with only the tv channels that are actually in use in the sportevents view?

#1209277

Nigel
Supporter

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

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

Hi Bob

The tricky part is that you add a date query filter to your child View so the parent View can't know whether the child View has any results or not.

I think what you need is to not output the TV channel in the parent taxonomy View, which should output nothing at all, and simply contain the child View in its output section.

Then in the child post View, you output the events in the loop, but just before the loop itself, after the wpv-items-found shortcode, output the taxonomy to generate the TV channel name. (I think wpv-post-taxonomy should work in this context.)

Do you want to try that and let me know if you run into any pitfalls?

#1209333

Thanks for your suggestion maybe I will give that a go.

I came up with a CSS way on my own by having the div set in taxonomy channel view like this <div class="row_cell [wpv-taxonomy-slug]"> and display:none for this in the css then in the Post View inside the loop I do <style>
.row_cell.[wpv-post-taxonomy type="tv-channels" format="slug"] {
display: block;
}
</style>

Seems to do the job and pretty easy to set up.