Sauter la navigation

[Résolu] Views lists all taxonomies but one

This support ticket is created Il y a 6 années et 2 mois. 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)

Marqué : 

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par Pat Il y a 6 années et 2 mois.

Assisté par: Nigel.

Auteur
Publications
#1143032

Pat

Hello,

I'm trying to display the list of all taxonomies (created with Types) but want to avoid displaying a specific one.

I have tried to place a filter on the ID or on the title but none of them work.
How could I do this?
Regards
Pat

#1143093

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Pat

This is a Taxonomy View, yes? To list taxonomy terms. And instead of specifying terms to include in the results (which is what the GUI lets you do), you want to exclude certain terms, yes?

If you include a particular term and then inspect the taxonomy_query_settings (available with the wpv_filter_taxonomy_query filter, which works much like the wpv_filter_query filter for normal Views that I think you are familiar with), you will see something like this:

Array
(
    [hide_empty] => 0
    [hierarchical] => 1
    [pad_counts] => 1
    [orderby] => name
    [order] => DESC
    [include] => Array
        (
            [0] => 8
        )

)

See how the term to include is specified. All you need to do is modify these settings so that you replace the include setting with an identical exclude setting.

https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_taxonomy_query

Is that something you can try yourself?

If you get stuck let me know and I will help out.

Could I also ask you an unrelated question?

We have just begun trialling offering chat support. When you created this thread you should have seen the option to chat immediately with support or to submit the thread as normal, and it seems like you chose to submit as normal.

Do you have any comments?

#1143115

Pat

Hi Nigel,

Good to hear you again.

I'm a little disappointed as I was thinking it could be easy to filter taxonomies (as it is for standard posts) with the post ID for example !!!
Reading your answer, it seems this is not the case.
In fact, I have found another solution : I have placed a conditional inside the Views loop in order not to take the specific taxonomy ID into consideration and this is working.
So, I'm OK with this.

Concerning the other point (chat), my experience shows that it could be time consuming. That's why I prefer, when the issue is not "urgent", to communicate by post. Then, I can arrange my time and continue to make other things until the answer is coming by mail (time sharing !) !!!

Regards
Pat