2

I put a custom css file in [custom.files]/custom/ (wp-content/uploads/civicrm/custom/) and it is not being read. I tested the same test entry in the civicrm/civicrm.css and it works there.

The entry for Resource URLs Custom CSS URL is [civicrm.files]/custom/

I cleared the cache for civicrm and Wordpress and it doesn't help.

I'm using WordPress 5.6 and civicrm 5.32.2.

7
  • Your setting needs to include the filename, e.g. [civicrm.files]/custom/myfile.css
    – Demerit
    Commented Dec 28, 2020 at 19:25
  • I tried that, but it doesn't work either at least for me. I checked again to make sure. I don't know what my issue is. But I tried using the css file in a WordPress child theme for our site and it works there and will not be overwritten by an update. So that is a simple solution for a simple problem now. Commented Dec 28, 2020 at 23:55
  • 1
    It might also be an access control issue for that particular folder since it can contain other sensitive info, e.g. .htaccess rules, or maybe something wordpress-specific I'm not aware of. If you look in the browser dev tools on the network tab you might see a 403 error.
    – Demerit
    Commented Dec 29, 2020 at 0:08
  • Yes, I do have a 403 error and the following is htaccess, which I don't understand. <Files "*"> # Apache 2.2 <IfModule !authz_core_module> Order allow,deny Deny from all </IfModule> # Apache 2.4+ <IfModule authz_core_module> Require all denied </IfModule> </Files> Would it hurt to just delete the .htaccess? Commented Dec 30, 2020 at 1:34
  • 1
    Yes, I am doing that now after giving up on the Resource Url approach. I am putting it in a style.css file in the WordPress child theme for the site and WordPress adds it. It won't get overwritten by updates there. I was trying not to mix the WordPress customization and civicrm customization, but it works and I can use it. I will look into using extensions. I just installed civicrm a few days ago and have a lot to learn. Commented Dec 30, 2020 at 2:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.