Skip Navigation

[Resolved] Need some help linking the WordPress Search Results to an Elementor Template

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 11 replies, has 2 voices.

Last updated by Waqar 1 year, 1 month ago.

Assisted by: Waqar.

Author
Posts
#2648771

I have created many Elementor templates in this site already, so in the same flow, I tought I'd set the "Search Results" in the Elementor conditionals for that template, but that didn't work.
I read in the forum I have to create a WordPress Archive via Toolset. Then I linked it to an existing Content Template. That kinda works, hidden link

It would be great though if that page would follow the layout from an Elementor template. Is that possible? Can I somehow insert that WP Archive in a template? Or a View that holds the search results?

#2649143

Hi,

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

From your description and looking into the markup of the search results archive, I understand that the layout is being controlled by Toolset, and the inner search result items are shown through the Elementor.

If your goal is to control this search archive completely through the Elementor, you can unassign the archive created through the Toolset and use the Elementor's theme builder option for creating this archive:
hidden link

regards,
Waqar

#2649817

The issue is, when I don't use Elementor to style the Search Archive, then the layout comes from our Astra theme and that layout is not in line with the rest of our site.

So I prefer to use the Elementor template, but then I don't get the appropriate View to work. I don't know how to adapt the Query filter so it filters the items based on the default WordPress filter parameter "?s=xyz"

#2649879

I have tried to replicate the Elementor Search Form with CSS, which took a lot of work 🙁
You can see both in the header now hidden link
I just can't seem to get it to work :'(

#2650037

Thank you for sharing this update.

I'm not completely sure exactly which part is not working. Can you please share some more details?

A quick screencast or screenshots would make it more clear.

#2650063
Screenshot_7.jpg

Sure, I'll try to explain the issue better.

I am happy to use the included WP search function and happy to use the Elementor Search Widget.
However, I have created a nice Toolset Content Template to display the Woo products grid (the one with the orange add to cart circle) so I wish to use that Content Template to display the WP Search Results.

I have created a Toolset View "Search Results" but that one totally ignores the WP search parameter in the url 🙁
hidden link so it just shows all products, but it does use the correct Content Template. So I I could correctly filter that View based on the search parameter, all would be good.

I have recreated the Elementor Widget in Toolset, but the form action goes to hidden link which does not load my View "Search Results".

#2650635

I tried to access the website's admin area through the access link from your other ticket. But looks like it has expired.

The WordPress default search archive is accessible at:
{yourwebsite.com}/?s=arran

If you'd like to use the Toolset content template for this search archive, you can go to WP Admin -> Toolset -> WordPress Archives and create a new archive for the search page. For the loop item of this archive, you can use the already-built template.

This way the search results on this link will be shown using that template.

#2650639

I have extended the WP login link.

1/ I have set the condition of the Elementor template to Search Results.
2/ I have entered this HTML code "[wpv-post-body view_template="loop-item-in-products-filter"]"

Search results are not ok
hidden link should show at least 3 items.
hidden link should show at least 7 items.

#2651359

I see the difference in the number of results showing in the search on the dev website and the live one.

But I don't have access to the admin area of the dev website. The access link for the dev website works, thank you.

Can you please also share the access details for the dev website as well? I'm setting your next reply as private.

#2651363

I've read your other ticket and was able to access the admin area of the dev website using the old link.

The way the Elementor template for search is working, I understand that it is showing only the first search result and not looping through all of them.

Why not unassign this 'Search Results' archive template from Elementor and instead create it through Toolset, as I suggested in earlier?
( WP Admin -> Toolset -> WordPress Archives )

It will allow you to use your desired content template [wpv-post-body view_template="loop-item-in-products-filter"] in the loop.

In case you'll prefer to use the search archive from the Elementor, you can consult its support or documentation, to understand how it can be made to loop through the search results instead of showing just one.

#2651473
search-results-3.jpg
search-results-2.jpg
search-results-1.jpg

DEV:
1/ I have used the shortcode [wpv-post-body view_template="loop-item-in-products-filter"] in the Elementor Search Results template, maybe that is why it only shows 1 item? But even if it showed all the results, the styling is still a bit off, because I am missing some div classes from the View (I am only using the Content Template).

2/ I have then deleted the Elementor condition from the template so it is no longer in use, then I get all the expected search results, but without styling. See the header "zoekresultaten voor: xxx" missing from screenshot 2.

3/ I have then created a WP Archive via Toolset and copied over the content of the loop editor from my Products Filter View. This is approaching the desired result the most, except I am missing the search results header with the Search Term and the page width is no longer conform my Elementor settings. But maybe I could work from here and add the required Elementor divs/classes/

#2651711

Thank you for sharing this update.

Yes, option 3, does seem to be the most appropriate option and it will give you the most flexibility and design control.

Please let me know if you have any follow-up question and for a new question or concern you're welcome to start a new ticket.

#2651751

I have almost achieved what I was looking for, but it's good enough 🙂