Custom Code

The Custom Code tab lets you add your own CSS, JavaScript and HTML across the whole site. It's split into three sections: Custom CSS, Custom JavaScript and HTML Snippets.

You'll find the tab in the Settings panel, under Themeasy → Settings. Click Save Changes to apply your changes; a "Settings saved." notice appears when they're saved.

Custom CSS

Field What it does Default
Custom CSS Site-wide CSS overrides. Don't include <style> tags. Empty
Build CSS to File (Recommended) Compiles your CSS to an external file for better caching and performance. If the file can't be written, the CSS is printed inline instead. On
Minify CSS Removes comments and unnecessary whitespace to shrink the file. Shown only while Build CSS to File is on. On

Custom JavaScript

Field What it does Default
Custom JavaScript Site-wide JavaScript. Don't include <script> tags. Empty
Build JS to File (Recommended) Compiles your JavaScript to an external file for better caching. If the file can't be written, the script is printed inline instead. On
Minify JavaScript Removes comments and extra whitespace. Turn it off if your code relies on complex regex patterns or edge cases. On
Script Position Where the script tag is printed: Header (before </head>) or Footer (before </body>). Footer
Defer Adds the defer attribute to the script tag. On
Async Adds the async attribute to the script tag. Not recommended if your code depends on other inline scripts. Off

Minify JavaScript, Script Position, Defer and Async are shown only while Build JS to File is on.

HTML Snippets

Raw HTML printed at three points of every page.

Field What it does
Head HTML Printed inside <head>. Use it for analytics tags, verification meta tags or preconnect links.
Body Start HTML Printed right after <body> opens. Ideal for tag managers that need to load early.
Footer HTML Printed before </body>. Good for scripts that can load last.
Disable for Logged-in Administrators Skips all three HTML snippets while you are logged in as an administrator — useful to avoid tracking your own visits. Off by default. It does not affect your custom CSS or JavaScript.

Note

The code editors show syntax highlighting unless you've turned off the "Syntax Highlighting" option in your WordPress user profile.

Warning

HTML snippets are printed exactly as you type them, on every page. Paste only code from sources you trust, and check your site in a private browser window after saving — with Disable for Logged-in Administrators on, you won't see the snippets while logged in.


Back to the Settings panel overview.

Was this article helpful?

Related articles