HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries for your WordPress theme, Use this code snippet and put it in functions.php.

function add_ie8_support() {
    $script = '<!--[if lt IE 9]>';
    $script .= '<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>';
	$script .= '<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>';
    $script .= '<![endif]-->';

	echo $script;
}
add_action('wp_head', 'add_ie8_support');

We use theĀ wp_head action hook to print the script into the site header. This requires wp_head() function present in header.php.