Link that will force a desktop view on mobile

Posted in: Newsmag
Post count: 21

Is there something that can force a desktop view on mobile instead of loading the responsive version? Something like

http://www.url.com/page?view=desktop

Thanks – eFromDC

Post count: 9544

No. But you can often set that in many web browsers for testing.

Post count: 21

No. I cant set that in the web browser. I need to be able to turn off the responsiveness on the fly in select cases…

Perhaps there is a way to apply css or javascript to force a desktop view upon a single wordpress page? So that page and that page only ALWAYS gives a desktop version…?

Post count: 9544

Sure. WordPress doesn’t have an option like that. You could likely setup some custom CSS with a javascript sniffer to swap out a different stylesheet without the mobile elements, much like the commonly used js which was used by many to swap out stylesheets to load different size fonts/sizes dynamically awhile ago.

Yes, you could setup a “custom” “page” template which loads an alternate stylesheet without the @media queries for mobile, so that there are no mobile styles at all. Just create new template for a page like “custompage” and then use normal WordPress practice for the custom page templates for that.

See the WordPress codex on how to build a custom page template to load automatically for a specific page, such either by name or page ID. For posts it’s trickier.

Much simpler to use a browser like Chrome where you can specify to “request desktop” version.

You might also be able to use built-in WordPress “if/then” logic to do something like “if post ID XXX, load style2.css, else load style.css” — but then you’d have another if/then query on every page; might work if it’s not a permanent thing. See WordPress codex on how to construct an if/then statement in your header.php template to do that. Then just clone the default stylesheet and remove all the @media queries for mobile.

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newsmag’ is closed to new topics and replies.