Skip Navigation

[Resolved] displaying a taxonomy within a view

This support ticket is created 5 years, 9 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by Minesh 5 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1196899

I have a custom post type with multiple custom taxonomies.

I can display the custom post type info and the custom taxonomies just fine.

there is one taxonomy that i want to display the items not checked.

EXAMPLE:

custom post type: CAR
custom taxonomy: color --> red, green, blue, pink, black
(in this case, red and black are selected for one of the Car entries)

So lets say I have a custom post type post with the name FORD MUSTANG and the COLORS i have selected are RED and BLACK. Well its easy to display the colors for that car.

but what I am having a hard time doing is displaying the colors for that car that are NOT selected on the same page ...

can you help with this please

thanks

#1196916

forgot to mention i am not displaying this on an acutal custom post type page. i am displying this via a view and filters on my homepage based on the loggedn in user ... see below.

filter:
Select items with field:
Institution Name is a string equal to VIEW_PARAM(userfi)

<!-- START institution boxx -->
<div class="your_inst">

<!-- START institution logo -->
<div class="inst_logo">
<img src="[wpv-post-featured-image size="full" output="url"]">
</div>

<!-- START content wrapper -->
<div class="your_inst_wrap">

<!-- START Core Providers -->
<div>
<h6>Core Providers</h6>
[wpv-post-taxonomy type="core_provider" format="name"]
</div>

<!-- START Bill Pay Providers -->
<div>
<h6>Bill Pay Providers</h6>
[wpv-post-taxonomy type="bill_pay_provider" format="name"]
</div>

<!-- START Institution Products -->
<div>
<h6>Institution Products</h6>
[wpv-post-taxonomy type="institution_product" format="name"]
-- <br>
[wpv-view name="upgrades-available"] <--- this is my view inside a view
</div>

#1197060

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - to check the term is assigned to post or not, you can use the [wpv-conditional] shortcode:

For example:

[wpv-conditional if="( has_term('red', 'color', null) eq '0' )" ]
 
Red is not assigned
 
[/wpv-conditional]

Where:
- Please register the has_term() function at:
=> Toolset => Settings => Front-end content tab => Functions inside conditional evaluations section

More info:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/#specific

#1197378

I have done that but I want to list all the terms that are not assigned ..

#1197759

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

There is no such feature available but I suggest you should write a custom shortcode that will return the unassigned terms to the post you are currently displaying.

OR

Create a taxonomy view to display terms and exclue the terms that are assigned to it. I think view will be a good solutoin.

#1203320

how do i exclude terms that are assigned to it?

thats what i was getting at the whole time

#1203740

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - as I try to share solution that either you should create a taxonomy view and exclude the current terms by using the view's API filter:
=> https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_taxonomy_query

OR

Create a custom shortcode that will return you the non-selected terms.

Please check below link that may help you:
=> https://wordpress.stackexchange.com/questions/12217/how-do-i-exclude-a-custom-taxonomy-from-the-post-loop

If you do not know how to do both ways, I need access details of your site and problem URL where you want to display such result.

*** Please make a FULL BACKUP of your database and website.***
I have set the next reply to private which means only you and I have access to it.