Skip Navigation

[Resolved] Category filter is showing all categories instead of only categories with posts

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

Problem: I have a custom search View that is set to only display available options for each input. However, all categories are shown as options in a category filter, when some of those categories should not be displayed.

Solution: Our developers have issued a patch to solve this problem, and will include the fix in a future release of Blocks/Views.

This support ticket is created 3 years, 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

This topic contains 22 replies, has 2 voices.

Last updated by MarkT8581 3 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1877391

Can you tell me briefly how the Latest Sermon View is inserted at the bottom of the menu? Is this custom code, a shortcode added somewhere else in wp-admin, a different plugin, etc? It's not immediately obvious to me.

#1877393

I've added the following code into my header.php file in my child theme:

/**
* Insert Latest Sermon View into Side Menu
*/
$args = array(
'title' => 'Latest Sermon for Side Menu',
);
echo render_view( $args );

#1877439

Okay again, nothing obviously wrong here. I set up a similar scenario on my local test site and added a View in header.php using the render_view API, but wasn't able to replicate the problem where terms without posts assigned are displayed in the filter. At this point I think it's best for me to create a clone of the site using the Duplicator plugin so I can install it locally and run more tests. Let me know if that's okay and I'll get started as soon as I can.

#1877529

Yes, you can do that. Thank you.

#1878235

Thanks, I've made that clone and installed it on my local environment. After stripping out 3rd-party plugins and themes, I was still able to reproduce the issue in a simple setup where the two Views were placed on the same page using the Block Editor. Depending on the order of the Views placement, the options in the taxonomy filter are different, which is odd. If the filtered View is displayed first, the options seem to be accurate. If the unfiltered View is displayed first, all options are displayed, incorrectly. So that seems like a bug to me, but I'm still not able to replicate the same issue in a test environment created from scratch. Something else is going on, and I'm not able to put my finger on it. I've escalated this to my 2nd tier team for more in-depth investigation, and I'll keep you posted here as I receive more information.

#1888009

Our second tier team has escalated this issue to the developers and I'll keep you posted here as I receive more information.

#1893863

Hello, our developers have provided a patch file to resolve this issue. Please download the file here:
hidden link

If you download the zip archive, you must extract the PHP file from that archive. Upload the file on your site to replace the same file in the directory here:
wp-content/plugins/wp-views/embedded/inc/wpv.class.php

I tested the modification on my local clone of the site and found that the problem was resolved. Please report the results on your site after applying the patch, and I will inform my developers of your findings.

#1894105

That fixed the problem. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.