Multiple Loops on Results Page
-
Hi,
Love the plugin by the way, light and clean to work with.
However I have a quick question or issue.I’m a full-time WordPress developer of 10 years.
So I’m very familiar with WordPress and coding result and templated pages for custom loops.I have set up the plugin “WPES is disabled for global WordPress search”.
Also created custom settings for Woocommerce search form.
I am then adding the hidden field to the website search form.
Which passes the “wpessid” param when searching for products.
This is working fine, and the results are correct.However, I have also coded a custom widget for the search results page sidebar.
Here I have a few additional loops to search for the same “search” text in some other post types too.However, these additional “new WP_Query()” calls are being affected by the “wpessid” param, and NOT returning posts.
To demonstrate this issue, if you visit the URL provided above.
You will see that the sidebar widget has “Pages (1)”
However, if you remove the “wpessid” from the url and refresh.
You will see that there are also “News & Blog” post counts also.But passing the “wpessid” param is affecting other loops on the same page.
Even though “WPES is disabled for global WordPress search”.
I think the issue is because they are on the same page.Please note that the 2 additional loops which are not returning results with the “wpessid” param set – News & Blog.
Are simply querying the standard wordpress posts post_type with “category_name” set to either “blog” or “news”.Strange!
If I query just for “posts” without the “category_name” in these additional loops then I get a result.
Is there a way to use the Extended Search functionality on if main_query.
But to NOT use the extended search functionality on other additional loops on the same page. Even with “wpessid” param set.I have checked the docs website but the information was very limited.
Any help would be greatly appreciated.
Love the plugin
Kind Regards
Philip C
The page I need help with: [log in to see the link]
- The topic ‘Multiple Loops on Results Page’ is closed to new replies.