Skip Navigation

[Resolved] Any way to show description (images) in a taxonomy checkboxes filter?

This support ticket is created 5 years, 11 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1191588

I've got a Taxonomy with tv channels. I've put channel icons in the description field like this

<img title="Channel name" src="/pics/channellogos/channellogo.png" alt="Channel name" width="50px" height="50px" />

Say i wanted to use the taxonomy in a Custom Search View checkboxes filter is there any way to show the channel logo instead of just the name like with the code below?

[wpv-control-post-taxonomy taxonomy="tv-channels" type="checkboxes" url_param="wpv-tv-channels"]
#1191699
Screen Shot 2019-01-27 at 6.24.55 PM.png

Hi, the available options for the wpv-control-post-taxonomy shortcode are elaborated upon here:
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-521572

As far as what's shown in the format section, there aren't any options for displaying custom termmeta values or the description field from the term itself. If you want to display icons instead of "name" or "count", you will have better luck using CSS that targets individual "label" elements and adds a background image somehow based on the corresponding input field.

For example, if your term name is "blue" and you have a background image called "blue.jpg" in some special background image directory, then you could target the label for this checkbox and add a background image. Something like this very simple example CSS:

label[for="your-taxonomy-slug-blue"] {
  background-image: url("<em><u>hidden link</u></em>");
}

https://css-tricks.com/attribute-selectors/
The syntax to target your checkbox labels might be slightly different, so you'll have to check the DOM. I'm attaching an example here showing how I set a background color, but you could just as easily use a background image.

Since you can't use Types or Views shortcodes effectively in CSS, this approach is only possible if you predefine the terms and images. Then with some CSS tweaks, you could display this background image instead of term text, or you could indent the text and display the background image before the text, or any other CSS effect.