Browse Happy

Not sure if this is required any more but this is how we used to add a message to a site for browsers using old versions of IE.


require get_template_directory() . '/components/browse-happy/template-tags-browser.php';

Add this to the header.php

<body <?php body_class(); ?> >
// add this line below...
	<?php gomo_browse_happy() ?>

Template tag code:

function gomo_browse_happy() {
	<!--[if lte IE 8]>
	<div class="browsehappy-container"><p class="browsehappy">You are using an <strong>outdated</strong> browser.<br />Please <a href="">upgrade your browser</a> to view this site.</p></div>
	gomo_browser_styles ();
function gomo_browser_styles () {
		.browsehappy-container {
			position: fixed;
			left: 0px;
			top: 0px;
			right: 0px;
			bottom: 0px;
			width: 100%;
			height: 100%;
			z-index: 99999;
			margin: 0px;
			padding: 0px;
			text-align: center;
			font-size: 60px;
			line-height: 90px;	
			color: white;
		.browsehappy {
			margin: 10% auto;
			max-width: 800px;
			text-align: center;
			font-size: 30px;
			line-height: 40px;	
			color: white;
		.browsehappy a {
			color: white;
add_action( 'wp_head', 'gomo_browser_styles', 1 );

Search the site


123 Main Street
P05T C0D3

Tel: 01234 567 899

Mob: 01234 567 899


Copyright 2023. Blah blah blah Company Limited