Skip Navigation

[Resolved] I need help with creating a custom search

This thread is resolved. Here is a description of the problem and solution.

Problem: I can't understand how to create a custom search like you can find in the Real Estate reference site if you click the "Apartments" main menu link. I can see a custom search View for Houses, but not custom search View for Apartments.

Solution: The custom search for Apartments is created with a WordPress Archive, since Apartments is a custom post type and you want to display this custom search on the archive URL /apartments/.

Relevant Documentation:
https://toolset.com/documentation/user-guides/creating-wordpress-custom-post-archives/

This support ticket is created 3 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.

This topic contains 3 replies, has 2 voices.

Last updated by SintiaO2938 3 years, 4 months ago.

Assigned support staff: Christian Cox.

Author
Posts
#1250245

Hi,

I’ve installed your Real Estate reference site and I’ve been studying it for a while as I want to apply it on a site I’ll be working on. The difference is that I’m going to use it with Elementor.

I’ve read your documentation quite lot and practiced it too, and everything worked well so far. The only the that I don’t get at the moment is that in your site (front-end), there’s a menu that the we use to choose if we want to see results for houses, apartments, lands or offices. When we click there, it’ll show a search that has different options depending on the item you choose on the menu. For instance, if you choose “house”, the search will show options like “min bedrooms” and “min bathrooms”. On the other hand, if you choose “lands”, another page will be displayed with a search that has options like “size min” “size max” (which “houses” doesn’t have, for example).

I see that there’s a view created for houses, which displays the search for it, but I’m not able to see how it works for the other post types like “apartments”, “lands” and “offices”, didn’t find a view to display a custom search for those. Don’t we have to create a view (to display custom search) for any of them, as well as a page that will display its view, which will be linked to the menu? How can I achieve that?

Documentations I've been reading:

https://toolset.com/learn/how-to-build-a-real-estate-website-on-wordpress/
https://toolset.com/documentation/user-guides/front-page-filters/
https://toolset.com/2016/03/developing-real-estate-sites-with-toolset/
https://toolset.com/2014/06/learn-build-flexible-parametric-searches/

Regards,

Sintia

#1250425

Hi, the custom search you see on the /apartments/ URL is actually created using a WordPress Archive. When you have a custom post type like "apartments", this URL is automatically created for you in WordPress. Then in Toolset, you can style that archive with a Layout containing a WordPress Archive cell. In wp-admin, go to Toolset > Layouts and then click the Layouts for Archives tab. You can find the Apartments archive Layout here. The second row in that Layout contains the Apartments archive cell. You can edit that cell to see the WordPress Archive created to display the Apartments custom search and the results.

One reason it's set up this way is it's not currently possible to split up the custom search fields and the results of a WordPress Archive into multiple pages. It is possible to do that with a View, which is why you are able to find the custom search View for Homes that is displayed on the front page of the RE site. If you go to the /homes/ page, you'll see that there is a similar WordPress Archive for homes, separate from the View shown on the front page of the site.

I hope this helps clear things up. Feel free to let me know if you have further questions about that.

#1251403

Got it! Thank you!

#1254607

Hi,

I was reading your documentation on how to design the archive pages with Elementor, but it looks like it is not possible. Is it right?
The documentation I read:
https://toolset.com/documentation/user-guides/using-toolset-with-elementor-page-builder/design-archive-pages-for-custom-post-types/
https://toolset.com/documentation/getting-started-with-toolset/customize-post-archives/

Regards,

Sintia