Support » Plugin: Zajax - Ajax Navigation » 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: http://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

    • This topic was modified 1 year, 8 months ago by  Aldoseri.
Viewing 2 replies - 1 through 2 (of 2 total)
  • also add this after the second directive on all instances

    wp_deregister_script( ‘zajax-js’ );

    
    wp_deregister_script( 'zajax-send-complete' );
    wp_deregister_script( 'fastclick' );
    wp_deregister_script( 'zajax-js' );
    • This reply was modified 1 year, 8 months ago by  Aldoseri.

    Hi! i’m having some troubles wwith this plugin and this option donest work for me, can you tell if i’m doing something wrong? I’m triyng to put in a “no-ajax” class container, putting in a iframe and this option than you present but nothing works. This is the code used to deregister zajax y one specific page

    function takeoff(){
    if (is_page( ‘login’ )){
    wp_deregister_script( ‘zajax-send-complete’ );
    wp_deregister_script( ‘fastclick’ );
    wp_deregister_script( ‘zajax-js’ );
    }
    }
    add_action( ‘removing_zajax’, ‘takeoff’ );
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to exclude loading on some pages?’ is closed to new replies.