I have a custom coded site which does not have a template/header file to paste the CometChat HTML code. How can I get CometChat bar on all the pages of my site?

To get the CometChat bar on all the pages of your site:

You need to manually add the CometChat HTML code on all the pages of the site after the <head> tag.

Your CometChat HTML code should be something like:

<link type="text/css" rel="stylesheet" media="all" href="/cometchat/cometchatcss.php" /> 
<script type="text/javascript" src="/cometchat/cometchatjs.php" charset="utf-8"></script>

Alternatively, if you have a java script file included on all your site pages, then you can simply paste the following code in that file:

window.onload = function () {
var cometchathead= document.getElementsByTagName("head");
var link=document.createElement('link');
link.href='/cometchat/cometchatcss.php?ts='+Math.random();
link.rel='stylesheet';
link.type= 'text/css';
link.charset = 'utf-8';
cometchathead[0].appendChild(link);
var script1=document.createElement('script');
script1.src='/cometchat/cometchatjs.php?ts='+Math.random();
script1.type= 'text/javascript';
script1.charset = 'utf-8';
cometchathead[0].appendChild(script1);
}

Not finding what you need?

The CometChat team is here to help!