[NSFW] Wrong display for tablet or desktop
-
Hello, when I activate the W3 settings I have problems with my retrotube theme by wp-script. This shows the mobile or tablet version of the theme, instead of desktop.
I previously had wp-rocket installed and had the same problem. But it was solved with this plugin: https://docs.wp-rocket.me/article/140-wrong-display-mobile-tablet-desktopNow I don’t know how to solve it with W3. Can you help me please?
-
Hello @luismt74
Thank you for your inquiry and I am happy to assist you with this.
You can use User Agent Groups.
Go to Perforance>User Agent Groups and there you can create (enable) a group of user agents by specifying names in the user agents field. Assign a set of user agents to use a specific theme, redirect them to another domain, or if an existing mobile plugin is active, create user agent groups to ensure that a unique cache is created for each user agent group. Drag and drop groups into order (if needed) to determine their priority (top -> down).
So if you are not using any mobile plugin simply enable the group and select your theme in the theme: drop-down menu, save all settings and purge the cache.
If you are using a mobile plugin, enable the group, keep the pass-through in the Theme: drop-down, and enter the redirect.
Thank you!Thank you very much for your help! Excuse me if I did not understand correctly. What I should do is: serve the tablet version as mobile, right?
So I create a new group named “tablet” and assign it to my theme. But what should I enter in “User agents”?Hello @luismt74
For mobile, you should enable the first two groups.
As for tablets you can create another group and add the User agents:
iPad
NexusTablet
SamsungTablet
HPTablet
AsusTablet
BlackBerryTablet
HTCtablet
MotorolaTablet
AcerTablet
ToshibaTablet
LGTablet
FujitsuTablet
LenovoTablet
DellTablet
SonyTablet
PhilipsTablet
HuaweiTabletMake sure to save all settings and purge the cache.
Thank yoU!Sorry, there are already two default groups: “tablets” and “phones”. Should I just enable those two?
Hello @luismt74
Yes, you can. And make are to select your theme in the dropdown.
Thank you!Thanks Marko! Two days passed and it works without problems. But it throws this error at me all the time:
PHP Warning: Cannot modify header information - headers already sent in /public_html/wp-content/plugins/w3-total-cache/Mobile_Referrer.php on line 35Compatibility Check reports this:
Server Modules & Resources: Plugin Version: 0.13.3 PHP Version: 7.3.17; Web Server: nginx FTP functions: Installed Multibyte String support: Installed cURL extension: Installed zlib extension: Installed brotli extension: Installed Opcode cache: Installed (OPCache) Memcached extension: Installed Memcache extension: Installed Redis extension: Not installed HTML Tidy extension: Installed Mime type detection: Installed Hash function: Installed Open basedir: On: /home/mysite/web/mysite.com/public_html:/home/mysite/tmp:/var/www/html:/etc/phpmyadmin:/etc/phpMyAdmin:/var/lib/phpmyadmin:/var/lib/phpMyAdmin:/etc/roundcube:/etc/roundcubemail:/var/lib/roundcube:/var/lib/roundcubemail:/tmp:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/share:/var/opt:/opt zlib output compression: Off set_time_limit: Available SSH2 extension: Not installed WordPress Resources /home/mysite/web/mysite.com/public_html/nginx.conf: OK /home/mysite/web/mysite.com/public_html/wp-content: OK /home/mysite/web/mysite.com/public_html/wp-content/uploads/2020/05: OK Fancy permalinks: /%postname%/ WP_CACHE define: Defined (true) URL rewrite: Enabled Network mode: NoWhat could be the problem?
Has anyone had this problem and managed to solve it? 🙁
Hello @luismt74
Can you please share the screenshot of your User Agent Groups settings?
Thank you!Yes, thanks for helping me Marko.
Hello @luismt74
Thank you for the screenshot.
You need to select your theme in the Theme: dropdown under 2. Phones.
save all settings and purge the cache.
Thank you!Thanks, but it won’t let me do it:
Duplicate theme "retrotube/retrotube" found in the group "tablets".To select my theme in the group “phones” I must remove it from “tablets”. In this way you would return to the same problem from the beginning, right?
Hello @luismt74
If everything is working as expected you should then disable the Phone group.
Or you should move the phone user Agents to the Tablets group.
Thanks!Thanks Marko, I just moved phone user agents to tablets, then removed the group phones. But the error continues, I don’t know what to do anymore. You may have to reinstall wp-rocket. 🙁
Hello @luismt74
thank you for the information. I’ve checked this and the warning:
PHP Warning: Cannot modify header information - headers already sent in /public_html/wp-content/plugins/w3-total-cache/Mobile_Referrer.php on line 35
suggests that some other code already has written content, so possibly there is some conflict which we cannot find remotely so you need to check the source of this.
Thank you!-
This reply was modified 6 years ago by
Marko Vasiljevic.
Thanks for your help Marko. Yesterday, after the changes, it continued to return the error. But 24 hours have passed and the error stopped. 🙂
I would like to get the Pro version. Is it possible to get a discount code?
-
This reply was modified 6 years ago by
The topic ‘[NSFW] Wrong display for tablet or desktop’ is closed to new replies.