Custom.css Not Working - Question | JoomShaper

Custom.css Not Working

P

Pascal

Template 3 days ago

Im using politicas template. Inside I added this custom.css : /templates/politicas/css/custom.css

But I noticed css not working But when I add this to custom css in template settings it is working??

How can I make sure it uses my first custom.css Using Joomla 5.4.1 PHP 8.2.29

Regards,

Pas

0
6 Answers
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 3 days ago #212742

Hoi Pascal,

in general it works, but in some older templates there was mistake and custom.css is loaded before template styles :/ and that's why you don't see your custom CSS changes.

To fix it right, you have to edit index.php file. Are you OK with that?

OR

2nd idea: Inside Template Options > Custom Code > Before Head just paste that line

<link href="/new_gb/templates/politicas/css/custom.css" rel="stylesheet"> Save & Close.

then that .css file will be loaded after all template styles and javascript. Not perfect, but 100% helps.

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 3 days ago #212743

If first fix idea is OK for you, and you're not afraid of touching php file. You can do that also from Joomla Template File Manager, or FileManager in cPanel. Remember to save changes. Quick move in few seconds.

info_3660_2025.jpg

$theme->add_css('custom'); that line must be moved down before JS files, line 161 seems to be empty. No risk.

0
P
Pascal
Accepted Answer
3 days ago #212744

I'm using latest Politicas 2.0.2 I prefer custom.css inside template for all customizations. What option is best to use and also update proof. Caould you explain how to ?

Regards, Pascal

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 2 days ago #212748

Use 2nd tip. From my first answer. Very robust method.

0
P
Pascal
Accepted Answer
2 days ago #212753

Thanks Paul,

Works great!

Regards, Pascal

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 2 days ago #212754

Great. Please mark topic as solved.

0