Adding script to the Head tags

Joomla template for easily build sports magazine website with advanced content display features and clean, unique design.
GK User
Tue Jun 11, 2013 7:21 am
Hi,
I need to add a header script to the pages for advertising, please help, I cannot find a way of inserting the script that it appears in the header tags of all pages.
Thanks
User avatar
Senior Boarder

GK User
Tue Jun 11, 2013 7:25 am
You need to modify:
/templates/gk_sporter/layouts/blocks/head.php

and add:
Code: Select all
$this->API->addCSS($this->API->URLtemplate() . '/css/CSSFILENAME.css');

or:
Code: Select all
$this->API->addJS($this->API->URLtemplate() . '/js/JAVASCRIPTFILENAME.js');

in right place
User avatar
Moderator

GK User
Tue Jun 11, 2013 7:50 am
Thanks, to make sure, this is the code that I need to insert:

<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>

<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/55218023/300x250-300x600_MyPlayers', [300, 600], 'div-gpt-ad-1370262610550-0').addService(googletag.pubads());
googletag.defineSlot('/55218023/300x250_MyPlayers', [300, 250], 'div-gpt-ad-1370262610550-1').addService(googletag.pubads());
googletag.defineSlot('/55218023/728x90_Top_MyPlayers', [728, 90], 'div-gpt-ad-1370262610550-2').addService(googletag.pubads());
googletag.enableServices();
});
</script>
User avatar
Senior Boarder

GK User
Tue Jun 11, 2013 8:43 am
oh, then You could add it before closing <body> in /layouts/default.php
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.