Skip Navigation

[Resolved] View returns no results when pagination is enabled

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 4 replies, has 3 voices.

Last updated by Waqar 1 year ago.

Assisted by: Waqar.

Author
Posts
#2659287
Screenshot 2023-11-01 152520.png
Screenshot 2023-11-01 152103.png

Tell us what you are trying to do?
We are setting up a new design for our search page. We want it to display 12 results at a time with a 'load more' infinite scroll button. When pagination is disabled, the results all load but it takes a really long time. When Pagination is enabled, no results return. We have similar views on other places on our site that work fine, using the same 'load more' button.

I disabled all of our other plugins and re-enabled them one at a time, and the view loads correctly with pagination when WP Bakery is turned off. I don't know what in WP Bakery could be conflicting with toolset's pagination, or why it works fine elsewhere but doesn't work on this specific page.

Is there any documentation that you are following?
I copied a lot of js from other support tickets.

Is there a similar example that we can see?
There is a functioning version of it on this page: hidden link. Swap to Past Events to show the button; its hidden when there are no more results.

What is the link to your site?
hidden link

#2659307

I can't find a way to make a reply private to share login details. Here is the view code:

____________________________________

Search and Pagination:
<div class="row">
<div class="col-sm-4"><div class="form-group">
<label for="wpv-wpcf-resource-type">[wpml-string context="wpv-views"]Resource Type[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-resource-type" type="select" default_label="All" url_param="wpv-wpcf-resource-type"]
</div></div>
<div class="col-sm-4"><div class="form-group">
<label for="wpv-growth-30">[wpml-string context="wpv-views"]Growth 30[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="growth-30" type="select" default_label="All" url_param="wpv-growth-30"]
</div></div>
<div class="col-sm-4"><div class="form-group">
<label for="wpv-growth-model">[wpml-string context="wpv-views"]Growth Model[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="growth-model" type="select" default_label="All" url_param="wpv-growth-model"]
</div></div>
[/wpv-conditional]
[/wpv-filter-controls]
[wpv-filter-end]

.search-button{width:60% !important;background:#b40e2f !important;color:white !important;font-size:16px !important;font-weight:700 !important;margin-left:20% !important;margin-top:25px !important;padding:16px 22px 16px 22px !important;height:52px!important}
.hidden-section {display:none}
.shown-section {display:initial}

(function ($) {
$(document).ready(function () {
$('.js-wpv-layout-infinite-scrolling').removeClass('js-wpv-layout-infinite-scrolling');
});
})(jQuery);
____________________________________
Loop Editor:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="3" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-4">[wpv-post-body view_template="loop-item-in-search-test-6-18"]</div>
[wpv-item index=other]
<div class="col-sm-4">[wpv-post-body view_template="loop-item-in-search-test-6-18"]</div>
[wpv-item index=3]
<div class="col-sm-4">[wpv-post-body view_template="loop-item-in-search-test-6-18"]</div>
</div>
[wpv-item index=pad]
<div class="col-sm-4"></div>
[wpv-item index=pad-last]
<div class="col-sm-4"></div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
<div class="center">
[wpv-pager-next-page force="true" class="w-btn us-btn-style_1"][wpml-string context="wpv-views"]<span class="w-btn-label">Load More</span><span class="ripple-container"></span>[/wpml-string][/wpv-pager-next-page]
</div>
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

.center { display: flex; justify-content: center; align-items: center;height:100px}
span.us-btn-style_1 {display: none !important;}
____________________________________

Loop Item:
[wpv-post-featured-image size=full]

a.featured-image {margin-bottom:25px !important}
#wpv-view-layout-6934 > div:nth-child(n) > div:nth-child(n) > p > a > img {margin-bottom:25px !important}

#2659443

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share both links the link where pagination with load more button works as expected and the link where load more button is not working.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2661949

Hi Braden,

Thank you for sharing these details.

Minesh is on vacation and I'll be following up on this ticket.

I'm currently performing some tests on my website with a similar view and pagination settings. Will share the findings, as soon as this testing completes.

Thank you for your patience.

regards,
Waqar

#2662053

Thank you for waiting.

During testing on my website with a view with pagination and WP Bakery enabled, I couldn't reproduce this issue of results not showing.

On your staging website too, I noticed that the 'WPBakery Page Builder' plugin is active and yet the pagination and the results are showing correctly on both pages ( 'DEO Events' & 'Search Results' ).
( screenshot: hidden link )

Can you please clear your browser's cache and then test the 'Search Results' page again? Have you made any changes meanwhile or may be it could be some temporary cache issue?

In case the issue persists, you're welcome to share the specific steps or a quick screen recording to better understand what you're experiencing.

#2662225

Hi Waqar,

Yes, we found the source of the issue. Autooptimize's javascript optimization was condensing code from WP Bakery and that we had added to the views in Toolset, causing a conflict that prevented the content to load.

Issue is resolved, thank you!