Add some code in <header>

October 08 Joomla Templates
GK User
Thu Feb 02, 2012 1:11 pm
Hi there,

I working on a 'the World news II' for Joomla 2.5 and I need to add some code for Google Analytics in <header>... but how?
Wich file contains the <header>...</header>?

I look at /templates/gk_twn2/layouts/blocks but I didn't find it...

Thank you in advance
User avatar
Fresh Boarder

GK User
Thu Feb 02, 2012 1:24 pm
Hi,

Add your code to this file \templates\gk_twn2\layouts\blocks\head.php

But before adding it please add this php close tag: ?>
Code: Select all
//CURRENT CODE
?>
//GA CODE GOES HERE
User avatar
Platinum Boarder

GK User
Wed Feb 15, 2012 9:58 pm
Don Lee wrote:Hi,

Add your code to this file \templates\gk_twn2\layouts\blocks\head.php

But before adding it please add this php close tag: ?>
Code: Select all
//CURRENT CODE
?>
//GA CODE GOES HERE


Hi DOn,
can you explain in detail?
User avatar
Senior Boarder

GK User
Thu Feb 16, 2012 9:52 am
Hi,

Sorry for not giving you details. I have an easier solution for you, add your GA code to bottom of this file \templates\gk_twn2\layouts\blocks\footer.php

The code won't be in header tag but it will work.
User avatar
Platinum Boarder

GK User
Thu Feb 16, 2012 7:46 pm
Don Lee wrote:Hi,

Sorry for not giving you details. I have an easier solution for you, add your GA code to bottom of this file \templates\gk_twn2\layouts\blocks\footer.php

The code won't be in header tag but it will work.



Hi Don,

how about addind header? i need to enter <meta name="google-site-verification" content="K2ezIjoA_sOsP0ZzGbeXdwfhxNScVy-s************" /> for google verificatio that need to embeded in the <head> section, before the first <body>
User avatar
Senior Boarder

GK User
Fri Feb 17, 2012 12:09 pm
Hi,

Try adding it to bottom of this file \templates\gk_twn2\layouts\blocks\head.php

The file generates head section for your site.
User avatar
Platinum Boarder

GK User
Sun Feb 19, 2012 6:33 pm
Don Lee wrote:Hi,

Try adding it to bottom of this file \templates\gk_twn2\layouts\blocks\head.php

The file generates head section for your site.



Sorry for troubling you DON..... how about </body> ? where i can find it? because i need to insert a script before </body> too
User avatar
Senior Boarder

GK User
Sun Feb 19, 2012 6:36 pm
Hi,

Please find it in file \templates\gk_twn2\layouts\default.php

Cheers,
User avatar
Platinum Boarder

GK User
Sun Feb 19, 2012 6:40 pm
Don Lee wrote:Hi,

Try adding it to bottom of this file \templates\gk_twn2\layouts\blocks\head.php

The file generates head section for your site.


Sorry again DON,

what im trying to do and achieved is... adding some script on my site, that will showing SSL Trustlogo from comodo that i purchased.

so they required me to insert below code exeactly before </head>

<script language="javascript" type="text/javascript">
//<![CDATA[
var cot_loc0=(window.location.protocol == "https:")? "https://secure.comodo.net/trustlogo/javascript/cot.js" :
"http://www.trustlogo.com/trustlogo/javascript/cot.js";
document.writeln('<scr' + 'ipt language="JavaScript" src="'+cot_loc0+'" type="text\/javascript">' + '<\/scr' + 'ipt>');
//]]>
</script>

and

insert below code before </body> :

<a href="http://www.instantssl.com" id="comodoTL">Instant SSL Certificate</a>
<script language="JavaScript" type="text/javascript">
COT("http://www.**********.com/cot_evssl.gif", "SC2", "none");
</script>

i already try to add on head.php, but its now showing
User avatar
Senior Boarder

GK User
Sun Feb 19, 2012 6:54 pm
Please PM me with FTP access then I will add them for you.
User avatar
Platinum Boarder

GK User
Sun Feb 19, 2012 6:57 pm
Don Lee wrote:Please PM me with FTP access then I will add them for you.



Ok DON, thanks for the help...really appreciate. Will PM you then
User avatar
Senior Boarder

GK User
Sun Feb 19, 2012 7:42 pm
I did it for you, please check the two files and confirm me if it works.
User avatar
Platinum Boarder

GK User
Sun Feb 19, 2012 7:46 pm
Don Lee wrote:I did it for you, please check the two files and confirm me if it works.



thanks don...i can see it wroking now.... btw, which file did u edit? so may be i can do it by my self next time :)
User avatar
Senior Boarder

GK User
Sun Feb 19, 2012 9:14 pm
Don Lee wrote:I did it for you, please check the two files and confirm me if it works.



Thanks again DON,

i can see you edit the head and default.php . Now i know where to edit :)
User avatar
Senior Boarder

GK User
Mon Feb 20, 2012 11:01 am
Yeah that's exactly what I have suggested you before. You're welcome, feel free to let me know if you need any other helps.

Cheers,
User avatar
Platinum Boarder


cron