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

The Design Squiggle

The Story of the Squiggle. In the early-nighties, a decade of grunge, raves and hip-hop, I was working as an illustrator and designer for Xerox

Read More »