Hi, I have a view in home page ( weyourconsult.com ) and when I select a new page, if Form submint is "AJAX refresh when clicking submit", I lost contents.
So I tried to select "Full page refresh when clicking Submit" but I would like that page scroll to the view anchor like you can see year: hidden link
If I put this code in Custom JS view section:
jQuery( document ).ready(function() {
jQuery('html, body').animate({ scrollTop: jQuery("#economia").offset().top-180}, 'slow');
});
always when I open weyourconsult.com the page scroll to #economia, but I would like that this happen only when I do some search or pagination view.
I tried also with this code in in Custom JS view section, but with no results:
jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function() {
jQuery( document ).ready(function() {
jQuery('html, body').animate({ scrollTop: jQuery("#economia").offset().top-180}, 'slow');
});
});
Can you please send me admin access details and problem URL and let me check whats going wrong with your setup.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.
What if you try to use the following code and replace with the existing custom JS code added to your view's custom JS section and check if that also fixes the issue with cancel event:
jQuery(document ).ready(function() {
jQuery.urlParam = function(name){
var results = new RegExp('[?&]' + name + '=([^&#]*)').exec(window.location.href);
if (results==null){
return null;
}
else{
return decodeURI(results[1]) || 0;
}
}
param = jQuery.urlParam('wpv_view_count');
cancel_param = jQuery.urlParam('wpv_orderby');
if(param == 23302 || cancel_param=='modified') {
jQuery('html, body').animate({ scrollTop: jQuery("#economia").offset().top-180}, 'slow');
}
});
jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
/**
* data.view_unique_id (string) The View unique ID hash
* data.effect (string) The View AJAX pagination effect
* data.speed (integer) The View AJAX pagination speed in miliseconds
* data.layout (object) The jQuery object for the View layout wrapper
*/
//jQuery("#economia").get(0).scrollIntoView({behavior: 'smooth'});
jQuery('html, body').animate({ scrollTop: jQuery("#economia").offset().top}, 'slow');
});
Hi Minesh,
thanks for your update. Now seems good!
If I add text in search box (for example "Gestione") or select a taxonomy from advanced search, works well with search botton and cancel button.
I have other two problems with post view (let me know if is better to open different tickets).
In Home Page, selecting Italian language, I should have 19 post coming from 4 CPTs: Bus POSTS, Bus HOW-TOs, Bus TOOLS, Produc Post. When I open a new Home Page in pagination I can see 4 pages, and this is right because I set 6 post for page (3 pages with 6 post and 1 page with 1 post).
When I change page I loose 3 posts.
Some of them has member level restriction, but seems that it's not the problem.
With default ordering (last updated) in first page I can see "Scheda Obiettivi per Ruolo" (Level: INTEGRATOR), but I can't see FAQs KMS that hasn't level restriction.
If I change order to Title I CAN'T see "Scheda Obiettivi per Ruolo" (Level.: INTEGRATOR) and I CAN see FAQs KMS that hasn't level restriction!
I attach two images with a summary about that.
I've also seen that when I load home page if I select page 3, below in pagination, two posts are overlapping.
What can I do to resolve that? I attach image.
As per our support policy - we entertain only one question per ticket. This will help other users searching on the forum as well as help us to write correct problem resolution summery for the original issue reported with this ticket.
As oritinal issue is already addressed - May I kindly ask you to open a new ticket with every new question you may have. Thank you for understanding.