• Resolved anymvs

    (@anymvs)


    Hello,

    I’m using this plugin in my custom theme and I can’t make it work in a multiple “if statement”… any ideas ?

    <?php if(is_mobile() || is_tablet() || is_iphone($version)) {
    	get_header('customheader');
    get_template_part('mobile-page',get_post_format());
     }else{?><?php get_header(); ?> 
    
    //*
    Code for index.php
    *//
    
    }

    Is working only for mobile, table and iphone function seems dead !

    Thank you !!

    https://wordpress.org/plugins/php-browser-detection/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    You don’t need to use all of those statements.. is_mobile() || is_tablet() are sufficient.

    Thread Starter anymvs

    (@anymvs)

    Thank you so much for your reply !

    I think the problem is with the function is_tablet() because I have already used what you say… I also post a simple echo ‘hello’; just see how is responding and again is working only for mobiles…

    Which devices are supported by the function is_table ? Because I believe that’s only for iPad etc

    I’m testing things in Samsung Galaxy tab!

    Thank you again for your respond!

    Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    Can you post a link to the page?

    Thread Starter anymvs

    (@anymvs)

    It’s in my localhost I didn’t finished the theme yet ! Would you like to make the updates to the main site and send you the link ?

    I try more simpler code:

    <?php if(is_tablet()) {
    get_template_part('mobile-page',get_post_format());
     } ?>

    No results !

    Thread Starter anymvs

    (@anymvs)

    Hi 🙂 Thank you for your help ! 🙂

    Problem solved !

    The problem was in my @media css style-sheet. I made a mistake and set media screen for table devices and that didn’t liked by your plugin :p

    Sorry about that my bad 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Problem with multiple "if statement"’ is closed to new replies.