PDA

View Full Version : Disable plugin for mobile users



maxasher
08-29-2012, 04:13 PM
Hello, I am having issues with post opt in form rendering correctly on mobile devices. The opt in box ends up lowering itself into the comments section. Is there a way I can disable all features of this plugin for mobile visitors?

Jean-Christophe Bisoux
08-29-2012, 04:22 PM
Hi,
Normaly WPS is not activated on mobile device, cans you send me the url of your web and also with wich mobile you have this issue ?

maxasher
08-29-2012, 04:24 PM
Hi Jean thanks for the quick response. Right now I am still in testing mode and only have it active for administrators - I logged in on my iPhone as admin to test, I noticed the Footer opt in does not appear but the post opt in form does. Would you like me to reply with URL when I push plugin live so you can test?

Jean-Christophe Bisoux
08-29-2012, 04:36 PM
Yes, you are true for the optin form it's not disable , i'm sorry at this time it's not posible to disable for mobile, do you try with css to correct this issue ?

maxasher
08-29-2012, 04:38 PM
The problem is I adjusted the height so it doesn't have a large gap at bottom when viewing from a computer, however when its on an iPhone the height isn't large enough. Is there a way to use CSS so it appears taller on mobile devices but not on computers?

Jean-Christophe Bisoux
08-29-2012, 04:45 PM
For the css, i think about responsive design : http://www.alistapart.com/articles/responsive-web-design/

maxasher
08-29-2012, 05:05 PM
I tried to change body for mobile phones with mobile CSS but it didn't change anything

body {
-webkit-text-size-adjust: 60%;
}

Jean-Christophe Bisoux
08-29-2012, 05:17 PM
I make a test on this page : http://www.wpsubscribers.com/beta/ with an optin form in the sidebar, if the screen is > 640px you see the form,

I use in css theme :


@media screen and (max-width: 640px) {
#custom_optin_form_widget-2{
display:none;
}
}

maxasher
08-29-2012, 05:19 PM
Nice, what call would I use for the post opt in form? #post_optin_form

??

Jean-Christophe Bisoux
08-29-2012, 05:30 PM
normally this one work (depends of your template) :


@media screen and (max-width: 640px) {
div#ia-optin-form{
display:none;
}
}

you can see here : http://www.wpsubscribers.com/beta/version-1-43.html

maxasher
08-29-2012, 05:39 PM
normally this one work (depends of your template) :


@media screen and (max-width: 640px) {
div#ia-optin-form{
display:none;
}
}

you can see here : http://www.wpsubscribers.com/beta/version-1-43.html

I tried adding this code to style.css and then simply adding to to end of post opt in in WPsubscriber settings but neither worked. Is there any other code I need to have to make it work?

Jean-Christophe Bisoux
08-29-2012, 05:49 PM
For me I add directly in header.php to test


<style>
@media screen and (max-width: 640px) {
div#ia-optin-form{
display:none;
}
}
</style>

if you use style.css, do you clean you cookies after ?

don't use the css custom from WPS it's not necessary

maxasher
08-29-2012, 06:09 PM
I tried adding that code in style.css as well as the custom css at end of post opt in, but it didn't work for either. Is there any additional code I need to add to make it function? Thanks for all your help.

Jean-Christophe Bisoux
08-29-2012, 06:15 PM
No, nothing more and just in your theme not in wps css custom

Try to add directly in header.php and clean your cache

maxasher
08-29-2012, 06:31 PM
Adding in header didn't work but I looked in my style.css and found this code:

/* Mobile */
@media only screen and (max-device-width: 480px) {
.entry-content {font-size:1em;}
.scrolltop {display:none;}
}

so I replaced with

/* Mobile */
@media only screen and (max-device-width: 640px) {
.entry-content {font-size:1em;}
.scrolltop {display:none;}
div#ia-optin-form {display:none;}
}

and I think that worked! I'll let you know if I have any issues with it. merci for all the help.