0

This isn't about using IE conditionals, here is my problem

I have a fixed width site, I'm using 960 grid and I like this, and it works in most browsers including ie8 and ie7.

Now I like that old browsers like ie7 ie8 and use the 960 file fixed width and default style.css wordpress and modern browsers use the fluid version of 960 grid.

Summarizing

a) In old browsers load fixed width 960. b) In modern browsers use the fluid version of 960 responsive to the site.

Modern browsers can be detected and used a style sheet for them and in older browsers another style sheet?

Is there any function in wordpress that allows loading a stylesheet if the browser is modern, and load another stylesheet if the browser is old?

0

You can use wp_check_browser_version().

It will return False on failure, array of browser data on success. Then Checking the browser data you can assign particular CSS stylesheet to particular browser.

Reference »

  • This function is engineered for admin (relatively low amount of users/browsers) and works via remote POST request to API. Highly not recommended to run in front end for every visit. – Rarst Mar 22 '14 at 18:23
  • Thank you for answering my question. What could be better solution to this case? I'm complicating things more than they should? – Gonzalo Guevara Mar 24 '14 at 2:34
0

WP performs some limited browser sniffing on load, there are $is_winIE and $is_macIE globals set when browser is detected as Internet Explorer. It doesn't detect versions however.

This seems precisely like a case for using IE conditionals.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.