Skip Navigation

[Closed] Archive page with Search: can Archive Search filter one specific taxonomy term?

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 11 months, 3 weeks ago.

Assisted by: Waqar.

Author
Posts
#2671201

Tell us what you are trying to do?
On an Archive page with Search, is there a way in the Archive Search to add a button to filter by a chosen taxonomy term? I can do this with a Custom Search Filter, but it shows all taxonomy terms. I just want a single button with one term. Can it be done?

Is there any documentation that you are following?
No

Is there a similar example that we can see?
No

What is the link to your site?
Staging site not online

#2671277

Hi,

Thank you for contacting us and I'd be happy to assist.

There are a couple of ways you can approach this.

One option is to let all the terms show through the regular search filter, but include custom CSS or JS code to hide the ones that you don't want to show.

Another alternative can be to include the regular search filter and copy its HTML/markup from the inspect element tool in the browser, on the front end. Then you can include that HTML/markup in a 'Fields and Text' block in place of the search filter block, only keeping the desired term's HTML markup.

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2671401

Thanks for the ideas...

Option 1 -- not ideal, a bit bulky and does not allow both a button for a term and a select for any term.

Option 2 -- tried this (did not understand 'Fields and Text' block functionality previously). This is getting closer.
But...

The theory is fine -- I can put the HTML markup in but have to ALSO have the Custom Search Filter ABOVE it in the page structure in the set or it does not work. This is OK (I can have both), but two select boxes (either checkbox or radio button) with the same function means that the checkbox for the single taxonomy term does not stay checked -- it instead checks in the ABOVE CSF.

Not sure how to get round this...
Any more ideas?

#2672509

Thanks for writing back.

For Option 2, you'll need some custom CSS code to hide the extra search filter and some JS code to detect which of the options is selected, once the search is performed.

If you could share the link to the archive page through an online staging website, I'll be able to share some more pointers.

The topic ‘[Closed] Archive page with Search: can Archive Search filter one specific taxonomy term?’ is closed to new replies.