Im struggling to include the following stylesheets in my template. Which file do i need to load them in?

    $doc =& JFactory::getDocument();
    $doc->addStyleSheet($this->baseurl . '/templates/gk_simplicity/css/social.css');
    $doc->addStyleSheet( '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css');

It seems that no matter where i add the code, neither are showing as loading in the < head > tag when i inspect the source, the font-awesome icons aren't rendering correctly either? I have implemented the code fine manually on a subdomain, so i know i do not need to include any additional files, other than those mentioned above.

Any suggestions? Regards Donna

  • Would you care to follow up with this? Abandoned questions are ugly. Did we solve your problem?
    – isherwood
    Jun 10, 2019 at 19:56

2 Answers 2


If you want to add it directly to your template's index file you might be better off using the JHtml::stylesheet method:

   JHtml::_('stylesheet', JUri::base() . 'templates/gk_simplicity/css/sample.css', true);

What you have there is intended to be used inside template functions.


  • Ok, i have tried that method too, placed it in the Index.php file, but still they are not loading? I'm baffled. I've sent a message to the template developer to see if they can shed some light on the situation.
    – Dtorr1981
    May 20, 2016 at 12:43

Reading through some of the Gavick Pro documentation, I believe you will need to firstly put all your font files in the following directory:


Once done, in the Template settings, set CSS Override to Enabled

Then, copy and paste the code from your social.css into the override.css file that they provide you with or the textarea named "Custom CSS Code"

Using this method to override what is already there, rather than alter it, means that your changes will not be lot in a template update

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .