Tagged: header.php
Hi guys!!!
I want to make sure I am not messing anything up. I am setting up Google DFP and there’s javascript they provide to add between <head> and </head> (I added it below)
This is from the Google site:
Document header
<!DOCTYPE HTML>
<html lang=”en-us”>
<head>
<meta http-equiv=”Content-type” content=”text/html; charset=utf-8″>
<title>Widgets Magazine</title>
<style type=”text/css” media=”screen”>
</style>
HERE GOES THE SCRIPT
</head>
Should I add it to header.php right after this piece of the code? Or somewhere else?
<!DOCTYPE html>
<html <?php language_attributes(); ?> class=”<?php echo ” html_{$style} “.$responsive.” “.$preloader.” “.$av_lightbox.” “.avia_header_class_string();?> “>
<head>
<meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
<!– page title, displayed in your browser bar –>
<title><?php if(function_exists(‘avia_set_title_tag’)) { echo avia_set_title_tag(); } ?></title>
Thank you so much!!!! :)
Warmly,
Havi
Hi havi,
Try adding the following to your functions.php file:
function google_dfp(){ ?>
your code goes here
<?php
}
add_action('wp_head', 'google_dfp');
Regards,
Rikard
Will try, Rikard!!! :)
I’ll keep you posted! (so far I think DFP is not quite linking to my Adsense)
Warmly,
Havi