Hello, please help me with next thing...
My site - hidden link
Testing page - hidden link
1) I created View with pagination - hidden link
2) Inside this View I need to realise "Read more" function ( hidden link ) for each item inside View. To do it I used simple wordpress plugin hidden link wich works exselent.
But! When I try to use pagination inside the View I get this - hidden link ( hidden link ). For some reason "Read more" plugin stop working.
I tried different pagination settings ( hidden link ) but the only option in which the plugin continues to work is to select the option "Pagination enabled with manual transition and page reload" - hidden link
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 - hidden link
JS file - hidden link
CSS file - hidden link
I will be very grateful for any help in solving this problem.
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
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 - hidden link
Is there some way to avoid this?
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.
My issue is resolved now. Thank you!