Skip Navigation

[Resolved] how to display taxonomy as radio button image filter

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display taxonomy terms as radio button image filter

Solution:
You need to create the custom shortcode to display taxonomy terms as radio button image and add this shortcode to the view's filter section.

You can find the proposed solution with reply here

Relevant Documentation:
https://toolset.com/documentation/user-guides/front-page-filters/

This support ticket is created 7 years, 3 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 9 replies, has 2 voices.

Last updated by Kristen Estes 7 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#552748
Screen Shot 2017-07-25 at 3.24.25 PM.png

I am trying to: we have a page with a filter set, page loads with the correct content for the filter, but the ajax pagination gets results as though there were no filter settings.

Link to my site: hidden link

I expected to see: Less duplicate posts, posts only from the filter category

Instead, I got: Duplicate Student results after "Load More"

#552945

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

well - I checked the URL you shared with us and I do not see any results is duplicating - am I missing any steps/trick here?

#553255

Strange, it doesn't seem to be duplicating them anymore, but I do see a lot of results that don't seem to be coming up. You can see ALL the testimonials for the filter here: hidden link

For instance: I don't see any video posts at all anymore, when previously they would come up!

#553316

Minesh
Supporter

Languages: English (English )

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

Well - I can see one video post at top of the page with the red background.

As your original issue is resolved - could you please try to open a new ticket with your each new question. This will help other users searching on the forum.

Thank you for understanding.

#553439

I wouldn't call this resolved as the filter isn't even working correctly, clear by all the results that aren't showing. This is the only remaining issue holding up this site launch, so I'd appreciate some conclusive, helpful support.

#553441

Minesh
Supporter

Languages: English (English )

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

Well - I would love to help you further.

Sorry but I do not see any filter on the page here:
=> hidden link

Am I missing anything? If yes, could you please tell me which filter you are talking about and for which view and page and what is your expected output?

#553445
#553517

Minesh
Supporter

Languages: English (English )

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

It was an interesting case and the mistake was you have added taxonomy filter using shortcode and that is your own custom way.

I've modified the shortcode that displays the taxonomy filter as given under:

function custom_categories(){
$args = array('type' => 'category',  'hide_empty'       => 0);
$categories = get_categories($args);
$echo ='';
 
  if(isset($_GET['wpv-category'])) {
    $selected = $_GET['wpv-category'];
   }
 
foreach($categories as $category) {
  if($category->slug === 'uncategorized')continue;
  $checked = '';
  foreach($selected as $k=>$v):
      if($category->slug==$v){ $checked = "checked=checked"; }
  endforeach;
  
  $echo .= '<div class="checkbox new_style" style="background-image:url('.z_taxonomy_image_url($category->term_id).'); "><label class="absolute_hover" for="post_category-'.$category->slug.'"><input id="post_category-'. $category->slug.'" class="js-wpv-filter-trigger" name="wpv-category[]" '.$checked.' value="'. $category->slug.'" type="checkbox">'. $category->description.'</label></div>';

  
 }
  
  return $echo;
}

add_shortcode('custom_categories','custom_categories');

Could you please check and confirm that now infinite scroll pagination works as expected and do not load all the results.

#553527

The pagination seems to be working now, but the issue of them not filtering anymore persists! I think it's just pulling up the same category over and over but in a different order. For instance, none of our video posts at all are showing up when previously they were!

#553536

Minesh
Supporter

Languages: English (English )

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

Well - I can see there are 11 results for first category "fear-of-change". The pagination set to display 4 results per page.

So go to the following link or click on the first category "fear-of-change":
=> hidden link
=> scroll down to fire infinite scroll
=> again scroll down to fire infinite scroll
=> You will see now video posts

#553540

Seems to work now, thank you!