• Hello. I’ve been trying to stop a plugin (used only in frontpage) from loading its scripts and style in all pages different from homepage. The problem is that they are loaded on init and not using wp_enqueue_scripts so I can’t use usual conditional tags as is_home() or is_front_page(). Can anybody suggest me if there is a way to do that? Thanx.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Quick and dirty hack (be advised, this isn’t the best idea, but it won’t hurt):

    if (strpos($_SERVER['SCRIPT_NAME'], 'index.php') !== false) {
      (put your script loading here)
    }

    Thread Starter christian70

    (@christian70)

    I made an attempt according to what you suggested me but it didn’t word… where am I wrong? I guess I’ll have to keep those damned files in all pages of my site…

    if (strpos($_SERVER['SCRIPT_NAME'], 'index.php') !== false) {  add_action('init','lbg_zoominoutslider_load_scripts');
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to disable scripts loaded on init?’ is closed to new replies.