How to get this in your head and out of header.php :: 2018-02-28 20:23:38

[SyntaxHLNumbers]

<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="02182018 WordPress theme">
<meta name="author" content="bill@speedwayfightclub.com">
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<style type="text/css" media="print">#wpadminbar { display:none; }</style>

[/SyntaxHLNumbers]
[SyntaxHLNumbers]

<?php

class GENERIC_custom_meta_tags {

function __construct(){
add_action('wp_head', array($this, 'GENERIC_add_meta_tag'));
add_action('wp_head', array($this, 'GENERIC_hook_nocache'));
}

public function GENERIC_add_meta_tag(){
echo '<meta charset="UTF-8"/>';
echo '<meta charset="' . esc_attr( get_bloginfo( 'charset' ) ) . '">';
echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
echo '<meta name="description" content="02182018 WordPress theme">';
echo '<meta name="author" content="bill@speedwayfightclub.com">';
}

public function GENERIC_hook_nocache() {
echo '<meta http-equiv="cache-control" content="no-cache" />';
echo '<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />';
echo '<meta http-equiv="pragma" content="no-cache" />';
}
}
// call it statically, or by instance, doesn't matter... just uncomment/comment appropriately below!
//add_action( 'wp_enqueue_scripts', 'GENERIC_custom_meta_tags::GENERIC_add_meta_tag', 11 );
//add_action( 'wp_enqueue_scripts', 'GENERIC_custom_meta_tags::GENERIC_hook_nocache', 11 );
//$GENERIC_meta_tags = new GENERIC_custom_meta_tags();

[/SyntaxHLNumbers]

« »