Adding code within the <head> tag Topic is solved

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
malloryw
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Fri Dec 21, 2018 6:57 pm

Adding code within the <head> tag

Post by malloryw » Mon Mar 04, 2019 11:22 pm

I'm adding a live chat feature to my website and I'm supposed to add a piece of code within the <head></head> tag of my website to make the chat live on the site. However, when I paste the code within, the chat widget does not show on my site (after clearing the cache, etc.). I'm editing the index.php file of my installed template. Is there a specific place within the head tag that I am meant to place code that I'm adding?

Thanks for your help!

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Adding code within the <head> tag

Post by sozzled » Mon Mar 04, 2019 11:27 pm

malloryw wrote:
Mon Mar 04, 2019 11:22 pm
Is there a specific place within the head tag that I am meant to place code that I'm adding?
The answer may depend on what template you are using. Perhaps you might tell us what template you are using with your J! website?

Some templates do not need you to modify the index.php file in order to add additional "code" for things like "adding a chat" to a website. As a general rule, it is not advisable to modify the index.php file.

malloryw
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Fri Dec 21, 2018 6:57 pm

Re: Adding code within the <head> tag

Post by malloryw » Mon Mar 04, 2019 11:37 pm

Sure, I am using the Prixomo Default template. My first step was to add custom code via their template editor. There's an option to add custom code before the </head> tag. When I did this, the chat widget did not appear. So I removed the code I had added, and added it to the index.php file instead. This also did not work as far as the chat widget appearing on the site.

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Adding code within the <head> tag

Post by sozzled » Mon Mar 04, 2019 11:57 pm

Remember that there are hundreds of thousands of J! templates that people can choose from, I don't know anything about the template you have described. I'm guessing that the template was designed by Themeforest. You may want to ask the developers of that template if they are aware of this matter and if they have any advice for you.

Again, as a general rule, it is not a good idea to modify the template's index.php file. Further, I don't know much about "adding a chat" to a J! website by adding some "code" to the template. Perhaps this "chat" feature cannot be added to your website that way? Maybe you can tell us what this "chat" feature is and where you read about adding it to a J! website by adding some "code" in the <head>...</head> section?

malloryw
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Fri Dec 21, 2018 6:57 pm

Re: Adding code within the <head> tag

Post by malloryw » Tue Mar 05, 2019 12:08 am

I understand. I would like to avoid modifying the index.php file as well. The template is no longer available on the Themeforest website and as such, I've been unable to find any documentation about it. The chat feature was developed by a company called Verity. It was from their developers that I was told to add the embed code to the <head> section.

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Adding code within the <head> tag

Post by sozzled » Tue Mar 05, 2019 12:29 am

Sorry, I don't know of any chat software from Verity for Joomla. Verity chat may not work with Joomla.

annahersh
Joomla! Guru
Joomla! Guru
Posts: 734
Joined: Wed Aug 15, 2018 8:23 pm

Re: Adding code within the <head> tag

Post by annahersh » Tue Mar 05, 2019 2:50 am

Place the code in a custom module. Switch to source code view and paste the code then assign to a position. That way you won't need to alter the template's index.php

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44074
Joined: Sat Apr 05, 2008 9:58 pm

Re: Adding code within the <head> tag

Post by Webdongle » Tue Mar 05, 2019 9:20 am

Some Live Chats are not Joomla extensions and require code to be placed in the head tag to fetch the script then code placed in the site to let it display. Is your Live Chat a Joomla extension ? If yes then which one if not then use one.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

malloryw
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Fri Dec 21, 2018 6:57 pm

Re: Adding code within the <head> tag

Post by malloryw » Tue Mar 05, 2019 5:18 pm

It is not a Joomla extension. I'm in contact with the developers of the chat feature to see if they are able to help at all. I thought that there was something I was doing wrong as far as pasting the code into the head tag, but perhaps you're right and it is not compatible with Joomla.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44074
Joined: Sat Apr 05, 2008 9:58 pm

Re: Adding code within the <head> tag

Post by Webdongle » Tue Mar 05, 2019 7:49 pm

If it has to go in the head tag look in the index.php of the Template.

Or see https://extensions.joomla.org/extension ... rfilters=1
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
creativesights
Joomla! Guru
Joomla! Guru
Posts: 642
Joined: Tue Jan 13, 2009 11:50 pm
Location: San Diego, California, USA
Contact:

Re: Adding code within the <head> tag

Post by creativesights » Tue Mar 05, 2019 8:36 pm

Big fan of regular labs Sourcerer for this. - https://www.regularlabs.com/forum/sourc ... ro-version
Andrew Crossan
CreativeSights
Professional Custom Website Design & Development in San Diego
https://www.creativesights.com

malloryw
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Fri Dec 21, 2018 6:57 pm

Re: Adding code within the <head> tag

Post by malloryw » Tue Mar 26, 2019 7:39 pm

Thank you all for your help. After speaking with the developers, we found CSS conflicts that were preventing the chat widget from showing up on the site.


Locked

Return to “Templates for Joomla! 3.x”