Home>Article>CMS Tutorial> How WordPress determines the browser
The following columnWordPress Tutorialwill introduce to you how WordPress determines the browser. I hope it will be helpful to friends in need!
Most of the current theme templates do not support the obsolete IE, which affects the experience. You can use the variables provided by WordPress to determine the browser used by the visitor, and then remind the user to upgrade. browser.
For example, add in the appropriate position of the theme template:
When someone uses IE to access the web page, a prompt message will be displayed. When someone uses IE to access the WP backend, there will be a similar prompt.
If you want to target other browsers, you can refer to the following variables, and so on.
$is_iphone (boolean) iPhone Safari $is_chrome (boolean) Google Chrome $is_safari (boolean) Safari $is_NS4 (boolean) Netscape 4 $is_opera (boolean) Opera $is_macIE (boolean) Mac Internet Explorer $is_winIE (boolean) Windows Internet Explorer $is_gecko (boolean) FireFox $is_lynx (boolean) $is_IE (boolean) Internet Explorer $is_edge (boolean) Microsoft Edge
Source code: https://codex.wordpress.org/Global_Variables
The above is the detailed content of How WordPress determines the browser. For more information, please follow other related articles on the PHP Chinese website!