• Resolved Jakets

    (@jakets)


    Is there any way to prevent a certain plugin from loading on the WpTouch mobile theme? I have lightbox plus on my main theme, and I don’t like how it functions on the mobile theme.

    Thanks,
    Jake

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Jakets

    (@jakets)

    Still looking for a solution, anyone?

    You could probably just use the remove_action( ) and remove_filter( ) functions to disable the hooks and filters that the lightbox plugin calls.

    Thread Starter Jakets

    (@jakets)

    @ batmoo: Any chance you could elaborate? I’m kind of a noob when it comes to stuff like that. I tried searching around and didn’t find much that helped. How exactly do I use those functions? In what file(s) and where within those files?

    Thanks!

    I’d say there are two possible options

    1) Add this to your functions.php

    global $wptouch_plugin;
    if ($wptouch_plugin->applemobile && $wptouch_plugin->desired_view == 'mobile') {
    	remove_action( 'wp_head', array( &$wp_lightboxplus, 'lightboxPlusAddHeader' ) );
    	remove_action( "init", array( &$wp_lightboxplus, "addScripts" ) );
    }

    2) Modify the lightbox plugin (downside is that if you upgrade the plugin, you’ll lose the fix). In the lightboxplus.php file, find the following line (it’ll be at the bottom):

    if (class_exists('wp_lightboxplus')) { $wp_lightboxplus = new wp_lightboxplus(); }

    and replace it with:

    global $wptouch_plugin;
    if ($wptouch_plugin->applemobile && $wptouch_plugin->desired_view == 'mobile') {
    	if (class_exists('wp_lightboxplus')) { $wp_lightboxplus = new wp_lightboxplus(); }
    }

    I haven’t tested it so there’s no guarantee it’ll work. But, hopefully it helps.

    Thread Starter Jakets

    (@jakets)

    You rock man! The first method worked flawlessly. I really appreciate it, my site now works really great mobile. ??

    Glad to help ??

    Thread Starter Jakets

    (@jakets)

    Hey batmoo, the fix you gave me is still working but I noticed under IE 2 minor errors being reported when on the mobile theme. I’m not sure if you can help or tell me much from these, but I figured it was worth a shot:

    Message: Object expected
    Line: 42
    Char: 1
    Code: 0
    URI: https://farmvillefanatic.com/
    
    Message: 'fn.colorbox.settings' is null or not an object
    Line: 246
    Char: 3
    Code: 0
    URI: https://farmvillefanatic.com/

    Thanks, let me know if you need more information and have an idea where I should look.

    Thread Starter Jakets

    (@jakets)

    I believe I fixed these. Go ahead and ignore this.

    @ batmoo:
    I have the same issue (sort of) as Jakets; I want to prevent Lightbox-2 plugin from loading only on my frontpage because it kills jCarousel functionality in my slideshow.

    I wonder if I could ask you for help with a similar solution in the functions.php as you so elegant did for Jakets? I’m just a noob and don’t know much about php code. I’ve searched and didn’t find anything to be very helpful.

    Thanking you in advance!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘WpTouch Prevent Plugin Loading’ is closed to new replies.