1. vincebodie
  2. Sherlock Holmes
  3. Commercial Templates
  4. Tuesday, 17 November 2026
  5.  Subscribe via email
Has anyone else seen this? Most of my sites are loading custom.css from:

/templates/j51_nadia/css/custom.css
/media/templates/site/j51_nadia/css/custom.css

What's the fix for this? I've now got two versions of the css file to work with and it is a real PIA.
Accepted Answer Pending Moderation
0
Votes
Undo
If you share a link to your website, it would be easier to help. There are various possibilities for this problem.
Accepted Answer Pending Moderation
0
Votes
Undo
If you share a link to your website, it would be easier to help. There are various possibilities for this problem.

Sure thing, here is one example:
https://experienceglass.com/

I see this on line 33:

<link href="/media/templates/site/j51_nadia/css/custom.css?4cadda" rel="stylesheet">


And then this right before the closing head tag:

/*--Load Custom Css Styling--*/

</style>

<link rel="stylesheet" href="/templates/j51_nadia/css/custom.css" type="text/css" />
</head>
Accepted Answer Pending Moderation
0
Votes
Undo
Did you upgrade the template/website from Joomla 3 to Joomla 4/5 or did you start directly with the Joomla 5 Version of J51_Nina ? It seems there are some old J3 leftovers? In old Joomla, the custom.css was loaded from /templates/... that was changed to /media/templates/... with Joomla 4/5.

It looks like that there is a old Joomla 3 block in the index.php of your template.

I would first create backups of both the `custom.css` files and the template's `index.php` file. Then I would merge both `custom.css` files into a single new file and store it in `/media/templates/site/j51_nadia/css/`.

Once this is done, you should remove the old references to `/templates/j51_nadia/css/` from your template's `index.php` file.

Don't forget... Backup :)
Accepted Answer Pending Moderation
0
Votes
Undo
Did you upgrade the template/website from Joomla 3 to Joomla 4/5 or did you start directly with the Joomla 5 Version of J51_Nina ? It seems there are some old J3 leftovers? In old Joomla, the custom.css was loaded from /templates/... that was changed to /media/templates/... with Joomla 4/5.

It looks like that there is a old Joomla 3 block in the index.php of your template.

I would first create backups of both the `custom.css` files and the template's `index.php` file. Then I would merge both `custom.css` files into a single new file and store it in `/media/templates/site/j51_nadia/css/`.

Once this is done, you should remove the old references to `/templates/j51_nadia/css/` from your template's `index.php` file.

Don't forget... Backup :)


Short answer is yes, upgraded from J3 to J4/5. I was thinking along the same lines as you and I will dig into it as you stated.
Accepted Answer Pending Moderation
0
Votes
Undo
You could post the content of your template index.php file, and we could check which parts need to be removed.
Accepted Answer Pending Moderation
0
Votes
Undo
Sure thing, here you go:


<?php
/*================================================================*\
|| # Copyright (C) 2023 Joomla51. All Rights Reserved. ||
|| # license - PHP files are licensed under GNU/GPL V2 ||
|| # license - CSS - JS - IMAGE files are Copyrighted material ||
|| # Website: http://www.joomla51.com ||
\*================================================================*/

defined('_JEXEC') or die;

$app = JFactory::getApplication();
$document = JFactory::getDocument();
$user = JFactory::getUser();
$this->language = $document->language;
$this->direction = $document->direction;

$document->setHtml5(true);
$params = $app->getTemplate(true)->params;

JHtml::_('bootstrap.framework');

// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$sitename = $app->get('sitename');
$menu = $app->getMenu()->getActive();
$menuParams = new \Joomla\Registry\Registry();
$pageclass = $menuParams->get('pageclass_sfx','');
$editing = false;
if (($option === 'com_config' && $view === 'modules') || ($layout === 'edit')) {
$editing = true;
}

require_once("php/config.php");
require_once("php/variables.php");

\JHtml::_('behavior.core');
\JHtml::_('bootstrap.framework');

?>
<!DOCTYPE html>
<html xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="metas" />
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
<?php include ("php/head.php");?>
<?php include ("php/scripts.php");?>
<?php echo $this->params->get('head_custom_code'); ?>
</head>

<body class="site <?php echo $option
. ' view-' . $view
. ($layout ? ' layout-' . $layout : ' no-layout')
. ($task ? ' task-' . $task : ' no-task')
. ($itemid ? ' itemid-' . $itemid : '')
. ' ' . $pageclass
. ($params->get('fluidContainer') ? ' fluid' : '');
echo ($this->direction === 'rtl' ? ' rtl' : '');
?>">
<div id="header_bg">
<?php require("php/layouts/social_icons.php"); ?>
<div id="container_header" class="j51container">
<div id="header" class="wrapper960">
<div id="container_spacer1" class="j51container"><div class="wrapper960">
<?php if ($this->countModules( 'header-1' )) : ?>
<div class="header-1">
<jdoc:include type="modules" name="header-1" style="none" />
</div>
<?php endif; ?>
<?php if ($this->countModules( 'header-2' )) : ?>
<div class="header-2">
<jdoc:include type="modules" name="header-2" style="none" />
</div>
<?php endif; ?>
</div></div>
<?php require("php/layouts/header.php"); ?>
<div id="container_hornav" class="j51container">
<?php require("php/layouts/hornav.php"); ?>
</div>

</div>

</div>
<?php if ($this->countModules('showcase')) { ?>
<div id="container_slideshow" class="j51container"><div class="wrapper960">
<?php require("php/layouts/slideshow.php"); ?>
</div></div>
<?php }?>
</div>
<div id="content-outer">
<div id="content">
<?php if ($this->countModules('top-1a') || $this->countModules('top-1b') || $this->countModules('top-1c') || $this->countModules('top-1d') || $this->countModules('top-1e') || $this->countModules('top-1f')) { ?>
<div id="container_top1_modules" class="j51container jarallax" style="background-position: 50% 0"><div class="wrapper960">
<?php require("php/layouts/top1_modules.php"); ?>
</div></div>
<?php }?>


<?php if ($this->countModules('top-2a') || $this->countModules('top-2b') || $this->countModules('top-2c') || $this->countModules('top-2d') || $this->countModules('top-2e') || $this->countModules('top-2f')) { ?>
<div id="container_top2_modules" class="j51container jarallax" style="background-position: 50% 0"><div class="wrapper960">
<?php require("php/layouts/top2_modules.php"); ?>
</div></div>
<?php }?>

<?php if ($this->countModules('breadcrumb') || $this->countModules('top-3a') || $this->countModules('top-3b') || $this->countModules('top-3c') || $this->countModules('top-3d') || $this->countModules('top-3e') || $this->countModules('top-3f')) { ?>
<div id="container_top3_modules" class="j51container jarallax" style="background-position: 50% 0"><div class="wrapper960">
<?php require("php/layouts/top3_modules.php"); ?>
</div></div>
<?php }?>

<div id="container_main" class="j51container"><div class="wrapper960">
<?php require("php/layouts/main.php"); ?>
</div></div>

<?php if ($this->countModules('bottom-1a') || $this->countModules('bottom-1b') || $this->countModules('bottom-1c') || $this->countModules('bottom-1d') || $this->countModules('bottom-1e') || $this->countModules('bottom-1f')) { ?>
<div id="container_bottom1_modules" class="j51container jarallax" style="background-position: 50% 0"><div class="wrapper960">
<?php require("php/layouts/bottom1_modules.php"); ?>
</div></div>
<?php }?>

<?php if ($this->countModules('bottom-2a') || $this->countModules('bottom-2b') || $this->countModules('bottom-2c') || $this->countModules('bottom-2d') || $this->countModules('bottom-2e') || $this->countModules('bottom-2f')) { ?>
<div id="container_bottom2_modules" class="j51container jarallax" style="background-position: 50% 0"><div class="wrapper960">
<?php require("php/layouts/bottom2_modules.php"); ?>
</div></div>
<?php }?>

</div>
<div class="clearfix"></div>
</div>

<?php require("php/layouts/base.php"); ?>
</div>

<?php echo ($body_custom_code); ?>

<?php if (!$this->params->get('top1_bg') || !$this->params->get('top2_bg') || !$this->params->get('top3_bg') || !$this->params->get('bottom1_bg') || !$this->params->get('bottom2_bg') || !$this->params->get('bottom3_bg')) { ?>
<?php $wa->useScript('template.jarallax'); ?>
<script>
jarallax(document.querySelectorAll('.jarallax'), {
speed: 0.5,
disableParallax: /iPad|iPhone|iPod|Android/,
disableVideo: /iPad|iPhone|iPod|Android/
});
</script>
<?php } ?>

<?php if (!empty($headerslideshow)) { ?>
<script src="/<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/jquery.vegas.js"></script>
<script>
(function($) {"use strict";
$(document).ready(function() {
$('body').vegas({
delay: <?php echo $headerslideinterval ?>,
timer: false,
slides: [
<?php
foreach ($headerslideshow as $item) { ?>
{ src: '<?php echo $this->baseurl ?>/<?php echo $item->header_slide_image; ?>'},
<?php } ?>
]
});
});
})(jQuery);
</script>
<?php } ?>

<jdoc:include type="modules" name="debug" />
</body>
</html>
Accepted Answer Pending Moderation
0
Votes
Undo
Because there is no CSS included, I asked Claude for help.
Accepted Answer Pending Moderation
0
Votes
Undo
I have "Load custom.css" set to Yes. My first thought was that this was also the setting in J3 and both the old and new paths were being loaded, but this site did not use a Joomla51 template in J3, it's new to the J5 setup.
[attachment]eg-admin.png[/attachment]
Attachments (1)
Accepted Answer Pending Moderation
0
Votes
Undo
I have "Load custom.css" set to Yes. My first thought was that this was also the setting in J3 and both the old and new paths were being loaded, but this site did not use a Joomla51 template in J3, it's new to the J5 setup.
[attachment]eg-admin.png[/attachment]
Accepted Answer Pending Moderation
0
Votes
Undo
Before doing any changes, don't forget the backup. ;)

The duplicate stylesheets don't come from this index.php. It doesn't contain a single CSS include. But it loads the files where they must be defined.

What the file shows
It is written in J3 style (JFactory, JHtml::_, require_once("php/config.php" )), but also contains a J4 call ($wa->useScript('template.jarallax') on line 141). So it is a hybrid, which matches what you see on the page.
The new, versioned links from /media/… come from <jdoc:include type="styles" /> (line 48).

The old links from /templates/… must therefore come from the included PHP files:
Lines 39–43 of the output (animate, vegas, hover, font-awesome, nexus) sit between the Joomla styles without a version parameter. That looks like $document->addStyleSheet(…), probably in php/config.php or php/variables.php (lines 37–38).
Line 252 (responsive.css) and line 433 (custom.css, directly below the comment "Load Custom Css Styling" ) are hard-coded <link> tags, probably in php/head.php (line 50).

This is a conclusion from the page output. The three PHP files themselves have not been seen.

Next step
Search for these spots on the server:


cd YOUR/DIRECTORY/TO/httpdocs/templates/j51_nadia
grep -rn "custom.css\|responsive.css\|addStyleSheet\|animate.css\|hover.css\|font-awesome.css\|nexus.css" php/ index.php


What has to go are the addStyleSheet calls for animate, vegas, hover, font-awesome and nexus, plus the two hard-coded <link> tags for responsive.css and custom.css. The include of custom.css from /media/… stays.

Important: order of steps
Merge custom.css first. If you remove the links first, you lose the rules of the old file, which currently determines the look.
Don't delete the whole /templates/j51_nadia/ folder. Line 152 still loads jquery.vegas.js from /templates/<name>/js/. That only applies if a header slideshow is configured, but it would break then.
The same line also contains "/<?php echo $this->baseurl ?>/templates/…". On an installation in the web root, that produces //templates/…, which is a wrong address. Check whether the slideshow works on the site, and change the path to /media/templates/site/…/js/ if needed, provided the file is located there.
Accepted Answer Pending Moderation
0
Votes
Undo
Okay, let's try a different way.

In my opinion, the duplicate loading comes from the J51 Nadia template itself, not from the J3 upgrade:

Claude AI:
- The page loads one set of stylesheets from /media/templates/site/j51_nadia/css/ and a second set from /templates/j51_nadia/css/ (animate, vegas, hover, font-awesome, nexus, responsive and custom.css).

- Both custom.css files exist and differ (about 18 KB in the old location, 15 KB in the new one). The old one is loaded last, so it currently wins.

- Switching "Load custom.css" to No would not help, because it appears to control both includes.

Plan:
1. Back up templates/j51_nadia and media/templates/site/j51_nadia.

2. Merge both custom.css files into the one under /media/templates/site/j51_nadia/css/. Use the old file as the base, since it determines the current look, and check the few lines that exist only in the new one. Please also change relative url() paths to absolute ones (e.g. /images/...).

3. Reduce /templates/j51_nadia/css/custom.css to a single comment line, so the second include is harmless and nothing gives a 404.

4. Clear the Joomla cache, hard-reload and compare the look.

The permanent fix is to remove the extra includes in templates/j51_nadia/php/head.php (and wherever addStyleSheet is called). A template update would overwrite that, so I'm reporting it to Joomla51 as well.

If you want to dig in, this command lists the relevant places:


grep -rn "custom.css\|responsive.css\|addStyleSheet" templates/j51_nadia/php templates/j51_nadia/index.php
Accepted Answer Pending Moderation
0
Votes
Undo
A template update would overwrite that, so I'm reporting it to Joomla51 as well.


Forget this part. I'm sure J51 is no longer maintained. :p It was Claude's idea.
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!

Join Our Newsletter

* indicates required
We respect your privacy and do not tolerate spam and will never sell, rent, lease or give away your information (name, email, number, etc.) to any third party. Nor will we send you unsolicited email.
Joomla51 - Mullaghmore, Co. Sligo, Ireland
Joomla51.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by
Open Source Matters
the trademark holder in the United States and other countries.

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.

Ok