Skip Navigation

[Resolved] Taxonomy Archive autopopulate in custom search

This support ticket is created 5 years, 9 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 5 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#1187707

Hi,
i created a taxonomy page named zona and i noticed that if i insert a custom search form in that it autopopulate it with the value.
It could be a good feature but i can't find any documentation about it

You can see and example here:
hidden link
In my case when you try to choose the zona it only shows the value of the current one, which is setted by the current one and the user can't choose others.

#1187987

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Alessandro

Archives are special, WordPress identifies the URL site.com/zona/montesacro/ and identifies it as the archive of posts with the montesacro term of the zona taxonomy, and so the database query it generates to return posts to display only returns posts with montesacro.

It is not possible at the same URL to display posts with different zona terms, and so a search filter for the zona taxonomy won't work.

You need to link to the other term archives (to change page url), or you can create a normal WordPress page to use for this same search and create a View that you add to the page with the same filter controls.

#1204253

Ok, i need assistance because i would like not to duplicate taxonomy pages for seo reasons.

I need to integrate the custom search also with taxonomies

#1204450

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You cannot add search filters to a custom taxonomy archive for that same taxonomy, it won't work (which is expected behaviour given how WordPress taxonomy archives are implemented).

What you can do is show a View instead, which searches posts and includes the taxonomy filter.

So create a View that does what you require, and instead of inserting it on some other page, insert it on the custom archive.

If you are using Layouts, create a Layout which you assign to the taxonomy archive, but don't include a WordPress Archive cell, include the View instead.

If you are not using Layouts you will need to edit the custom archive at Toolset > WordPress Archives and in the output section make sure that no fields are output by the archive itself (between the wpv-loop tags is empty), and insert your View immediately after the wpv-layout-start shortcode in the Loop Editor.