Customizing Geodirectory Search Results Page and WordPress Search Results Page using Elementor Pro and jQuery – @pixallus


Geodirectory v2 comes packed with features. I’m especially glad they finally decided to shortcode everything. This gives us more control of the dynamic layouts when using a page builder like, Elementor Pro. Designing the Geodirectory Archives, Single Post, and Loop Items were fun tasks even if having to learn all of the changes Geodirecroty v2 offers. It’s definitely an improvement.

During upgrading to Geodirectory v2, I came across an issue with search results page. When creating a Search Results template and assigning it via Elementor Pro, I noticed that we lost the default WordPress search results page. I tried several methods to separate the search results pages, without luck.

I ended up creating a Search Page template in Elementor Pro that included both the default WordPress search results and the Geodirectory v2 search results. I set the Elementor conditions for the template to Search Results. Now when I search from either the Geodirectory search bar or the default WordPress search bar, I can see both results. However, this isn’t exactly what I wanted.

I want to display search results for one or the other depending on which search bar was used. So I added a class to each results section in the template and then added some jQuery to determine which class to display based on the URL. See the code below.

if ('search') > -1){
} else {

This probably isn’t the best way to handle this and I believe the Geodirectory is working on a fix. But for now, this will work for us. If you need help or guidance, please feel free to post in our support forums!

Share this page
Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on email
Pixallus Website Giveaway

We understand COVID has created shifts in many people’s lives. That’s why we’ve decided to giveaway a fully functional website with all the tools you

Read More »
How to Choose WordPress Hosting

Pixallus WordPress Hosting. Simplified. Enjoy blazing fast WordPress website loading speeds and 99.9% uptime. Whether you’re a freelancer, small business, or a large organization, we

Read More »