Hello!
After designing my categories and attributes, I noticed that when the users (or myself) navigates to the All Listings page, the default category that is selected is “All Categories”, which is not something I’ve set-up, and beneath this I can see the first level of categories actually defined by myself.
Instead of having this, I would prefer seeing directly the two main categories I’ve set-up (Men and Women), with none of them selected by default.
I tried looking for the “All Categories” in the Settings but it isn’t defined anywhere. I also tried hiding it via CSS or removing it via PHP, but I cannot get the right hook on it.
Please note that All Categories is not a category in the WordPress Dashboard, but an option so that users can search for listings in all categories. If you hide this option, then when users select a category in the search, they will never be able to restore the search back to the top-level (all categories). To remove this option, you will need a PHP snippet.
Thank you both for the replies! @condorito.fr the CSS snippet you shared was a very accurate shot in the dark - it did just what I wanted, removing the “All Categories” thing.
Now, as also pointed out by andrii, I realized I need a “reset” button for the filters, for which I tried the PHP snippet you shared above. However, while the “Reset” button appears correctly, when I press it doesn’t reset any filters - instead, it returns a “Nothing found” page, as if it’s trying to search the keyword “reset”. Any idea what could cause this?
Actually, this snippet just adds some HTML (here a link) on top of the filter form sidebar (let’s call it that way).
The link needs to reflect your own context (website links organization).
TLDR : it has to be the URL your audience access the first time (before they start messing around with the filters, including categories).
Since you did not provide your site URL, I tried to provide a probable url for the “listings” page.
That time the shot in the dark was not so accurate.
PS : I went as far as displaying the LINK (with a simple yet effective jQuery animation) only when the user has already changed some settings. It does not appear at first, when not needed.
Ah, that makes sense!
Unfortunately I cannot share the URL as I’m still developing on LocalWP, with no “live” environment yet. However, I understand the idea - will try to replicate.
The jQuery animation is also a nice touch - could use this as well.
Hey @condorito.fr - just saw this. I didn’t even think about this UI issue with the categories that get hidden after one is selected, but the OP is right - it’s better if all of them remain available (especially until AJAX filtering is rolled out for Hivepress, which I very much wait).
Also, just wanted to mention that I also managed to fully solve the filter reset button for this topic using your help. Thanks again!