Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #865267

    Hello,
    when in Edge, Enfold adds the chrome classes to the HTML tag. See screen:

    https://image.ibb.co/cH6FRR/edge.jpg

    Pls fix, i really need to fix some issues in edge.

    Heres a hotfix for anybody with the same problem (paste in functions.php):

    	//add class for edge
    	function get_browser_name($user_agent)
    	{
    		if (strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR/')) return 'Opera';
    		elseif (strpos($user_agent, 'Edge')) return 'Edge';
    		elseif (strpos($user_agent, 'Chrome')) return 'Chrome';
    		elseif (strpos($user_agent, 'Safari')) return 'Safari';
    		elseif (strpos($user_agent, 'Firefox')) return 'Firefox';
    		elseif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) return 'Internet Explorer';
    		
    		return 'Other';
    	}
    		
    	if (get_browser_name($_SERVER['HTTP_USER_AGENT']) == "Edge") {
    	  	// Add class to Body via Filter function
    		add_filter( 'body_class','add_body_classes' );
    		function add_body_classes( $classes ) {
    			$classes[] = "edge";
    			return $classes;
    		}
    	}
    • This topic was modified 7 years, 2 months ago by DUALWERK.
    #865537

    Hey DUALWERK,

    Thanks for the feedback.

    Best regards,
    John Torvik

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.