Link to stylesheets and other files in your theme
How to link to stylesheets, JavaScript, images, and other files from your Shoporama theme using the $theme_url variable.
When you link to stylesheets, JavaScript files, or images in your Shoporama theme, it is important to use the correct paths. Here is how to do it right.

Use $theme_url
The variable {$theme_url} points to the root folder of your theme. Use it to link to all files in your theme:
<!-- Stylesheet -->
<link rel="stylesheet" href="<{$theme_url}>/css/style.css">
<!-- JavaScript -->
<script src="<{$theme_url}>/js/main.js"></script>
<!-- Image -->
<img src="<{$theme_url}>/img/logo.png" alt="Logo">
Why $theme_url?
The reasons to use {$theme_url} instead of a hardcoded path:
- Portability — the theme works no matter where it is installed
- CDN support — the URL can automatically point to a CDN
- Flexibility — the theme folder can be moved without changing any code
Other useful URL variables
| Variable | Description |
|---|---|
| {$theme_url} | The theme's root folder (for CSS, JS, and images) |
| {$baseurl} | The store's full URL (e.g. https://myshop.com) |
| {$webshop} | The webshop object with all settings |
Important
Never use absolute paths such as /user_templates/4/mytheme/css/style.css. They will break if the theme is moved or installed in another store.
Need help with theme development? Contact us at support@shoporama.dk.
Related articles
Custom CSS: style your store and admin with your own stylesheet
Add custom CSS to your Shoporama store and admin panel to change colors, fonts, and layout or hide elements without editing theme files. You can...
Email templates in your theme: complete overview
Overview of all email templates in Shoporama themes. Learn what each template does, when it is sent, and which variables you can use to customize...
Implement Theme Builder in your theme
A guide to implementing Shoporama's Theme Builder in your theme, so the store owner can build pages visually.