2

Wordpress Client wanted to have mobile devices (phones only) display a single image with links to cell and email rather than go to the responsive version of the website. I use media queries to determine break point of 600px width to display the website for desktops and iPads and display image only for phones.

Now client wants to add another link so mobile users can choose to go the responsive version of the website.

I can't see how I can do this unless? Was thinking using a landing page for mobile devices only might work - but how can that be done? And how can you link to the website vs image if you are using the same media queries?
URL: [iocomm.com] Thanks for any help!

Anne Pouch
  • 163
  • 1
  • 1
  • 6

2 Answers2

1

If you are ok with wordpress plugin, then install wp-splash-page and In the file /wp-splash-page/inc/class-wp-splash-page.php, add this condition just before the return true; statement in the test() function:

if ( $this->settings['show_on_mobile'] && ! $this->detect->isMobile() && ! $this->detect->isTablet() )
            return false;

It is working like a charm

Ashkar
  • 692
  • 5
  • 16
0

That's fairly simple. You can use JavaScript cookies to determine whether they want to view the responsive version. You can set this cookie via an anchor element. I would set the breakpoint rules onto a class calling it maybe .non-responsive and adding it to the <body> tag. On page load, you'd check whether the cookie is set to true and then remove the breakpoint class from the body showing the responsive website.

adamj
  • 4,049
  • 5
  • 41
  • 58