Skip Navigation

[Resolved] Filters in an archive not working

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 13 replies, has 1 voice.

Last updated by Minesh 1 month, 3 weeks ago.

Assisted by: Minesh.

Author
Posts
#2794827

I have created a View which displays and allows users to filter results on my website. The filters in the view work well. However, they do not work in a parallel WP archive. The two should be pretty much identical, allowing users to seamlessly go to the Search page (View) and then click on any category, keyword, etc., and still filter results in the same way.

It applies to four filters:
- Year
- Medium
- Difficulty
- Recommended Use

The Topics, Languages and Traditions filters seem to work just fine.

hidden link - you can see the View here, click on any taxonomy to see the archive.
Can you please help me work out what's up with those filters in the Archive? Thanks!

#2795026

Christopher Amirian
Supporter

Languages: English (English )

Hi,

I'm not sure if I see any difference between the pages.

I went to hidden link

Clicked "vegetarianism" and redirected to:

hidden link

Expanded "Value Theory" category and selected Value and it shows the results:

hidden link

Would you please give me the steps on what to do to see the issue?

Thanks.

#2795264

Thanks for looking into this. Sounds like you're just accessing the archives without using the filters. Click on 'FIlters' next to the Search button to expand the filters. That's where you'll see what I described. Also, Minesh was helping me with this before, perhaps he'd know.

#2795417

Minesh
Supporter

Languages: English (English )

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

Just to ensure we are on same page.

Can you please tell me for what taxonomy archives you want to apply the filter. Can you please tell me what taxonomy archive you are using? Do you only want to apply on taxonomy archive or post type archive?

Do you want to apply the same filter for use and difficulty as I shared solution before?
=> https://toolset.com/forums/topic/filter-comparison-like-vs-contains/#post-2794161

#2795497

Hi Minesh,

I want to filter by the following taxonomies:
- Topics
- Traditions
- Languages

And the following custom fields:
- Publication Year
- Medium
- Difficulty
- Recommended Use

I want all those filters to be available on the following taxonomy archives
- Topics
- Traditions
- Languages
- Figures
- Keywords

The Archive I am using is FilterArchives.
The View where all of this is working fine is FilterSearch.

I am not using different post types, so only apply to posts.

Yes, please use with the same custom code for Difficulty and Recommended Use you created.

The login credentials for the site are the same as before.

I hope that helps. Thank you!

#2796172

Minesh
Supporter

Languages: English (English )

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

The thing is that if you are on the "Topics" taxonomy archive page for term xxx then you can not filter the results with term yyy as you are on the taxonomy archive page of xxx.

Having said that, you can not filter taxonomy archive which belongs to same taxonomy. It's basically not supported.

For instance - here is the taxonomy archive link:
=> hidden link

If you notice the Topics filter it will only offer the option "applied-ethics" as you can not add other term result on the "applied-ethics" term. Thats against WordPress standard. So it applies to other taxonomy term archive as well.

#2796229

Thanks for looking into it. I don't think I'd ever want to filter by the same taxonomy as the one that's displayed in the archive. This shouldn't be a problem.
The odd thing is - the (other) taxonomy filters are working just fine. It's the custom field filters that aren't. I'm also pretty sure that they did work before, I worry something changed after you added the custom code that ensures that the difficulty and recommended use work as 'contains' not 'equals'.

#2796287

Minesh
Supporter

Languages: English (English )

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

I'm not sure if you understand what I said.

Please go to this taxonomy archive URL:
=> hidden link

And click on the "Filters" button and notice the "Topics" multiselect filter. As you are on the "applied-ethics" taxonomy archive - it will only offer the option "applied-ethics" as you can not add other terms posts while displaying "applied-ethics" taxonomy term archive. I hope that clarifies. Having said that - you can not filter with other "Topics" taxonomy terms.

This is applicable to all taxonomy archives and to all taxonomy filters you have.

The odd thing is - the (other) taxonomy filters are working just fine. It's the custom field filters that aren't. I'm also pretty sure that they did work before, I worry something changed after you added the custom code that ensures that the difficulty and recommended use work as 'contains' not 'equals'.
===>
There is nothing changed and the code I added is applied to views and the custom code added for views will not be applicable to taxonomy archive.

Also I noticed that something changed now
=> hidden link

I do not see any records with above taxonomy archive which I do used to see. What changes you made? have you added any code or configurataion changes?

#2796617

Thanks for clarifying. If I understand right, what you mean is that when I'm displaying an archive for taxonomy Topic (applied ethics in your example), I won't be able to further filter the results by Topic. The same applies to every taxonomy. Correct? If so, this is not a problem as long as I can still filter by other taxonomies and custom fields.

I have not made any changes to your code or any configuration. The point about something changing after you added the code was a guess - I don't really know what happened.

So, how do we make those custom field filters work the same way they do in the FilterSearch View?

#2796748

Minesh
Supporter

Languages: English (English )

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

Ok - I would like to confirm that - I've implemented only two filters with your previous ticket you shared.

You want to only implement for "Recommended Use and Difficulty" same as before as we have to exclude the taxonomy filters like "Topics".

#2797826

That other ticket was a different ticket, as you always say. This one is about the custom field filters not working on the archives. I think I explained it above in as much detail as I can.

Did you do something with the site? Because now it comes up with a message and doesn't let me log in:
Connection Information
To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

#2797930

Minesh
Supporter

Languages: English (English )

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

I've not done anything, please get in touch with your hosting authority and check with them whats going wrong with your setup.

The ticket is different in a way that one is applied to views and this one is for archive.

You can take the reference os the previous ticket and try to use "pre_get_posts" hook to add query argument on fly.

I'm also not able to access your site.

#2798526

OK, it's sorted. Some space issues on the server, apparently the logs were switched on and clogged the space. The site should be working now and allow you to log in.

#2798723

Minesh
Supporter

Languages: English (English )

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

I still see the same issue - I could not able to login to admin and I can still see the FTP login with "Connection Information" at top of the page.