Passer la navigation

[Résolu] Conflict between Tools and Read more plugin

This support ticket is created Il y a 4 years, 8 months. 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 -

Fuseau horaire du supporter : Asia/Karachi (GMT+05:00)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par Serhii Il y a 4 years, 8 months.

Assisté par: Waqar.

Auteur
Publications
#1903971

Hello, please help me with next thing...

My site - lien caché
Testing page - lien caché

1) I created View with pagination - lien caché
2) Inside this View I need to realise "Read more" function ( lien caché ) for each item inside View. To do it I used simple wordpress plugin lien caché wich works exselent.

But! When I try to use pagination inside the View I get this - lien caché ( lien caché ). For some reason "Read more" plugin stop working.

I tried different pagination settings ( lien caché ) but the only option in which the plugin continues to work is to select the option "Pagination enabled with manual transition and page reload" - lien caché

The problem is that this option does not suit me. I need pagination without reloading the page and changing the URL address (or at least just without reloading the page).

------------------

Is there some way to solve my problem using Toolset settings?

Or maybe it might be possible to make some minor edits to the plugin?

The plugin looks simple enough and consists of three files:
PHP file - lien caché
JS file - lien caché
CSS file - lien caché

I will be very grateful for any help in solving this problem.

#1904775

Hi,

Thank you for contacting us and I'd be happy to assist.

The Show More plugin seems to execute some script when the page is reloaded. But if the page's content is refreshed using AJAX (e.g. for pagination or search filters), that code is not executed.

To make sure that code is also executed when the AJAX operation completes for pagination or search filters, you can include the following code in the view's "JS editor":


jQuery( document ).on( 'js_event_wpv_pagination_completed js_event_wpv_parametric_search_results_updated', function( event, data ) {
	jQuery('.wpsm-content').addClass('wpsm-content-hide')
	jQuery('.wpsm-show, .wpsm-hide').removeClass('wpsm-content-hide')
	jQuery('.wpsm-show').on('click', function(e) {
		jQuery(this).next('.wpsm-content').removeClass('wpsm-content-hide');
		jQuery(this).addClass('wpsm-content-hide');
		e.preventDefault();
	});
	jQuery('.wpsm-hide').on('click', function(e) {
		var wpsm = jQuery(this).parent('.wpsm-content');
		wpsm.addClass('wpsm-content-hide');
		wpsm.prev('.wpsm-show').removeClass('wpsm-content-hide');
		e.preventDefault();
	});
});

regards,
Waqar

#1905141

Wow, that is amazing thanks alot for your help. It seems like decision of my issue.

Everything is almost perfect except for one thing. After moving to the next page of View pagination, the Read more plugin expands for a second, and then collapses - lien caché

Is there some way to avoid this?

#1905311

Thanks for the update and glad that it worked.

That flicker is a result of how the Show More plugin works. It first loads the read more content and then hides it using the custom CSS classes controlled through the script. As a result, the content is visible momentarily, before the script is executed.

I'm afraid, I can't think of a workaround to overcome this, but you can get in touch with that plugin's author, to see if he/she can share some suggestions.

#1905443

My issue is resolved now. Thank you!