How to exclude loading on some pages?
-
Hi Guys,
This is a quick fix to prevent loading Zajax on some pages such as woocommerce shopping cart or other Ajax pages that conflict with the plug in.
1- In your theme’s function.php add the following code (Change page name accordingly)
function my_deregister_javascript() { if ( is_page('activity') ) { wp_deregister_script( 'zajax-send-complete' ); wp_deregister_script( 'fastclick' ); } if ( is_page('members') ) { wp_deregister_script( 'zajax-send-complete' ); wp_deregister_script( 'fastclick' ); } if ( is_page('groups') ) { wp_deregister_script( 'zajax-send-complete' ); wp_deregister_script( 'fastclick' ); } }
change activity, members, groups etc… to suit your page names
2- In the main menu or any wordpress generated menu use relative URLs to disable Zajax ex: https://my-cool-site.com/members/ change it to /members/ and save the menu. Now when you click on the link your page will load normally.
I didn’t include the style function because the css file is small.
I hope this helps
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to exclude loading on some pages?’ is closed to new replies.