Skip Navigation

[Resolved] I have problem with sorting

This thread is resolved. Here is a description of the problem and solution.

Problem:
Images added in a view through flexslider are showing on page reload, but not when search parameters are changed

Solution:
Suggested to adjust the flexslider script, so that it initializes not only on page reload but also when AJAX results are loaded.

Relevant Documentation:

This support ticket is created 5 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

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 2 voices.

Last updated by jetmirA 5 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#1211809
22.PNG
11.PNG

Thanks to Christian Cox i was able to install in a post flexslider , but now i have another problem on the search , when im sorting the post , image disapear 🙁

#1211845

Hi,

Thank you for waiting.

During troubleshooting, I noticed that the code to initialize the "flexslider" script executes only when the page reloads, but not when the results are updated using AJAX (i.e. without the page reload).

Also, the same script is being included twice in the view, which is not needed.

1. "JS editor" tab in the "Search and Pagination" section
2. "JS editor" tab in the "Loop Editor" section


// Can also be used with $(document).ready()
$(window).load(function() {
  $('.flexslider').flexslider({
    animation: "slide"
  });
});

To make this work with page reload and also with AJAX load, please follow these steps:

1. Please remove the existing script mentioned above from both places and only include the following, in the "JS editor" tab in the "Search and Pagination" section:


// function to process flexslider
function processFlexslider()
{
	$('.flexslider').flexslider({
		animation: "slide"
	});
}

// load processFlexslider function on page load
$(window).load(function() {
	processFlexslider();
});

2. Add processFlexslider in the "will run after updating the results" field, under the "Custom Search Settings" section, as shown in the screenshot:
hidden link

I hope this helps and please let me know how it goes.

regards,
Waqar

#1211846

still not working sir , can you check it

#1211850

The new code that I suggested in step 1, was missing from the view.

I've added it ( screenshot: hidden link ) and it is now working.

Note: The old code is still included in "Loop Item - Grid" content template's "JS Editor" tab:
hidden link

Please remove it, as it is no longer needed.

regards,
Waqar

#1211852

My issue is resolved now. Thank you Mister!