• I will begin my saying I am not a developer. I am using certain elements inside a page that are compatible with chrome but are not compatible with others browsers like Internet Explorer for example. Is there any known plugin I can use to hide content based on browsers? I just want to be clear, the problem is with IE on desktops, I hid those elements on mobile devices.

    Thank you, I would greatly appreciate your help.

Viewing 1 replies (of 1 total)
  • Use this plugins to detect the browser:
    https://wordpress.org/plugins/php-browser-detection/
    OR
    https://wordpress.org/plugins/advanced-browser-check/

    If you can work with JavaScript, you can also use this code to detect the browser:

    function detectBrowser(){
      var val = navigator.userAgent.toLowerCase();
    
      if( (val.indexOf("chrome") > -1) || (val.indexOf("opera") > -1) || (val.indexOf("msie") > -1) || (val.indexOf("safari") > -1))
      {
        $(document).ready(function() {
          // code to hide the contents comes here
        });
      } else if(val.indexOf("firefox") > -1)
      {
        $(document).ready(function() {
          // code to hide the contents comes here
        });
      }
    };

    Hope this helps 🙂

Viewing 1 replies (of 1 total)

The topic ‘Hiding page content based on browser’ is closed to new replies.