|
/ Documentation /CartFlows/Code Snippets/ How to Enable the Theme’s Scripts & Styles without Changing the Page Template?

How to Enable the Theme’s Scripts & Styles without Changing the Page Template?

By default, CartFlows intentionally does not load your theme’s header, footer, or styling on funnel pages. This ensures maximum flexibility and avoids design conflicts—especially helpful when creating focused, distraction-free checkout experiences.

Why the Header & Footer Are Hidden

To maintain full design control and prevent potential layout issues, CartFlows uses its own template for funnel pages. If you’d prefer to show your theme’s header and footer, the recommended approach is to set the page template to Default in the page editor. Here’s how to do that.

However, in some cases, you may notice that the header and footer appear without styling—especially when not using a Default template. If you’d like to load your theme’s CSS and JavaScript files without changing the page template, you can use the following filters.

How to Load Theme Scripts & Styles with a Filter

Add the following code snippet to your child theme’s functions.php file:

/**
* Filter to load theme's styles & scripts.
*
* @param bool $remove_styles true/false
* @return bool $remove_styles true/false
*/

add_filter( 'cartflows_remove_theme_styles', 'wcf_load_theme_files', 10, 1 );
add_filter( 'cartflows_remove_theme_scripts', 'wcf_load_theme_files', 10, 1 );

function wcf_load_theme_files( $remove_styles ){

$remove_styles = false;

return $remove_styles;
}

💡 Need help adding custom code? Follow this guide to safely insert custom code into WordPress.

Once added, your theme’s styles and scripts will load on CartFlows pages—even if you’re not using a Default template.

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