Skip Navigation

[Resolved] The content template shows several custom fields from the "Center" CPT.

This support ticket is created 2 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Roberto Miguez 2 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#2402101
centros.png
centros-2.png

hidden link

This is a view with filters and search box that shows a loop of "Centers" (custom post field).

The content template shows several custom fields from the "Center" CPT.

It seems that the search functionality works for titles, but what about custom fields? Are they searchable?

I checked the "Include this field in text searches".

There are 5 centers in Arrasate (a city), but when searching for "Arrasate" in the search box, only those centers who have "Arrasate" in their titles are shown. It seems that the search is not performed through the custom fields.

#2402287

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

HI Roberto,

Thank you for getting in touch.

It is possible to have your text search go through your custom fields. To do this you will need to follow the instructions in the link below.
https://toolset.com/course-lesson/searching-texts-in-custom-fields-with-toolset-and-relevanssi/

Thanks,
Shane

#2404093
relevanssi-localidad-registered.png
view.png
relevanssi-localidad.png
relevanssi-centros.png

Thank you for your guidance, Shane.

I followed the steps in the lesson:

1. "Centros" CPT is ticked as Index in Relevanssi. (screenshot)
2. "Localidad" custom field is a single line field and has "Include in search" ticked. (screenshot)
3. wpcf-localidad is registered in Relevanssi. (screenshot)
4. Index is built in Relevanssi.

But I get the same result: only Centers that have the City name in their titles are shown.

The view is built in legacy mode, not with Blocks, but Blocks is installed.

I´m attaching a screenshot of the view configuration, too.

Is there something I´m missing?

#2404357

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Roberto,

The documentation assumes that you're adding the search for the first time. However you will need to remove the search filter shortcode from your view and then delete the query filter for it. It should pop up once you delete the search filter shortcode and save your view.

Re-add your search bar and then Select the option that includes the custom field when you're re-adding the search.

Thanks,
Shane

#2405419

Re-adding the search box with the right option did the job.

My issue is resolved now. Thank you!