WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WpTouch Prevent Plugin Loading (10 posts)

  1. Jakets
    Member
    Posted 4 years ago #

    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

  2. Jakets
    Member
    Posted 4 years ago #

    Still looking for a solution, anyone?

  3. Mohammad Jangda
    Member
    Posted 4 years ago #

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

  4. Jakets
    Member
    Posted 4 years ago #

    @ 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!

  5. Mohammad Jangda
    Member
    Posted 4 years ago #

    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.

  6. Jakets
    Member
    Posted 4 years ago #

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

  7. Mohammad Jangda
    Member
    Posted 4 years ago #

    Glad to help :)

  8. Jakets
    Member
    Posted 4 years ago #

    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: http://farmvillefanatic.com/
    
    Message: 'fn.colorbox.settings' is null or not an object
    Line: 246
    Char: 3
    Code: 0
    URI: http://farmvillefanatic.com/

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

  9. Jakets
    Member
    Posted 4 years ago #

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

  10. Indent
    Member
    Posted 4 years ago #

    @ 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!

Topic Closed

This topic has been closed to new replies.

About this Topic