Archived topic
using generate-disable-mobile plugin
9 replies · Started by Bisola on September 19, 2017
Hi, I'm using the generate-disable-mobile plugin and it's working fine. However, the screen on the mobile is not taken up by the whole page so the user may need to zoom in or adjust it themselves.
I was wondering if there was a way to allow the whole screen to be taken up by the page.
Thank you in advance of any help you guys can provide.
Hi there,
Any chance you can link us to the page?
Thanks!
If you visit it on your phone you'll see what I mean
Looks pretty good to me? https://s26.postimg.org/5umcdgpjd/IMG_6509.png
Hi there,
Instead of using that plugin, we can now do this:
add_fiter( 'generate_meta_viewport', 'tu_disable_mobile' );
function tu_disable_mobile() {
return '<meta name="viewport" content="width=1024">';
}
1024 being your container width.
Hello Tom thank you for the response,
Where exactly do I add that piece of code?
Thank you in advance for your response.
I would really appreciate a response as this is an issue I'd like to solve as quickly possible.
Thank you for anyone that can response
Try one of these methods: https://docs.generatepress.com/article/adding-php/
Hi Tom and Leo, I was able to successfully implement your suggestions so thank you so much for the help.
I was going to ask if it was also disable mobile version for some pages but leave it as mobile version for some other pages?
Thank you in advance of any help you are able to provide
You can use conditional tags like this:
add_fiter( 'generate_meta_viewport', 'tu_disable_mobile' );
function tu_disable_mobile() {
if ( is_page( 'my-page' ) ) {
return '<meta name="viewport" content="width=1024">';
}
}
More info here: https://codex.wordpress.org/Conditional_Tags#A_PAGE_Page