I’ve noticed WordPress sites that have classes in the <html> tag related to browser detection (if I use Firefox the html tag would have a .firefox class, even a version-detected .firefox16 class, and so on). Example, http://achristmasstorythemusical.com.
Is this a default WordPress function like body_class() or do I have to create one? How would I do this?
I’ve noticed WordPress sites that have classes in the <html> tag related to browser
Share
Unfortunately, I found no default WordPress browser detection class nor function. There are plugins that offer browser detection. However, I found a simple answer looking at the code snippet here. I just modified the code to return some basic browsers and added it to my functions.php file.
Then, I added the function to my html tag.
This will return the name of the browser I’m using as a class. For my immediate purpose, it’s enough. I hope you find this answer useful.