WordPress.org

Ready to get started?Download WordPress

Forums

WP Mobile Detect
can't activate (8 posts)

  1. muhamed.fejziu
    Member
    Posted 1 year ago #

    Hi..I try to install and activate this plugin but I get this: Fatal error: Cannot redeclare class Mobile_Detect in /home/content/10/10689710/html/wp-content/plugins/wp-mobile-detect/mobile-detect.php on line 35

    thanks!

    http://wordpress.org/extend/plugins/wp-mobile-detect/

  2. zackcello
    Member
    Posted 1 year ago #

    I received the same error! Any fix?

  3. jupp25
    Member
    Posted 1 year ago #

    same error for me.

    any idea`s / fixes?

    thx

  4. njs
    Member
    Posted 11 months ago #

    Same here, shame.

  5. Maxaud
    Member
    Posted 10 months ago #

    put an if statement in front and after the class definition.

    if ( !class_exists( 'Mobile_Detect' ) ) {
    
        class Mobile_Detect {
            ...original class code....
        }
    
    }

    I'm the author of the "Mobile CSS" plugin here:
    http://wordpress.org/plugins/mobile-css/

    It uses the same class but correctly checks to see if it's already defined.

  6. Maxaud
    Member
    Posted 10 months ago #

    Any progress here?

  7. JBinJPN
    Member
    Posted 8 months ago #

    Shame - seems like a really good plugin - I tried this, but to no avail. You may need to be a bit clearer as to where the closing brackets go (or better still, post the code in it's entirety if possible

    Thanks

  8. Maxaud
    Member
    Posted 8 months ago #

    @JBinJPN

    Put
    if ( !class_exists( 'Mobile_Detect' ) ) {

    on the line right before

    class Mobile_Detect {

    and put

    }

    right after

    }

    that is the closing bracket for the Mobile_Detect class.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.