|
/ Documentation /CartFlows/Developer Docs/ How and Where to Add Custom JS, CSS, and PHP Codes

How and Where to Add Custom JS, CSS, and PHP Codes

You may sometimes need to add custom JavaScript, CSS, or PHP code to your site for custom functionality or styling. Below are the methods to safely do this.

Use a Plugin (Recommended for Most Users)

For simplicity and safety, you can use a plugin that allows adding custom code without touching theme files. This works for JavaScript, CSS, and PHP.

We recommend:

These plugins let you manage your code snippets in a user-friendly way, and they remain active even after theme updates.

Add Custom JavaScript

CartFlows Funnels Only

Go to Funnel Setting > General section. The script will only apply to the specific funnel.

Funnel Custom JavaScript

Add Custom CSS

Custom CSS can be added to two places, either add it to a specific funnel or to the Customizer.

Adding custom CSS to a specific funnel can be done similar like adding JavaScript to a funnel. Go to Funnel Settings > General section. The CSS will be applied only to the specific funnel.

Funnel Custom CSS

Adding custom CSS to the Customizer can be done by going to to Appearance > Customize > Additional CSS.

Additional CSS Field

Add Custom PHP

Using a Child Theme

Add your PHP code inside the functions.php file of your child theme.

Child Theme

Using a child theme ensures your custom code won’t be lost when updating the theme. If you’re not familiar with what a child theme is, refer to this article.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page