Css link to local wp-content/themes/

Issue Summary

CSS link to a file in my local /wp-content/themes/ directory doesn’t work, but link to /wp-content/uploads/ does.

Troubleshooting Questions

This CSS does NOT show the phone image
.phone:before { background-image: url(’/wp-content/themes/mytheme/images/icons/phone.svg’);}

But this CSS DOES work.
.phone:before { background-image: url(’/wp-content/uploads/2021/07/phone.svg’);}

System Details

Local version: 6.1.0+5452
Operating System is macOS Big Sur (11.5)

It’s hard to say what the issue is without seeing any errors.

The main things I would recommend exploring:

  1. Open the browser console – are there any errors there about the site not able to load that image?

  2. Does the image exist in that location?

Oh my! Very embarrassing. i had a space before the ‘icons’ directory! Thanks for your reply. I will mark this as ‘solved’.

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.