Carrington Build Documentation

Script and Style Request Handlers (cfct_action URLs)

You may notice you have two requests being made if you have Carrington Build integrated into your theme:

  • http://example.com/?cfct_action=cfct_css
  • http://example.com/?cfct_action=cfct_js

These are request handlers to allow for the Carrington Build styles and scripts to be loaded in along with additional dynamic styles added by rows or modules.

This is handy as it allows a Module or Row add its own Carrington Build-specific styles and scripts to the page without a separate HTTP request (for a new .css or .js file). However, this dynamic generation of the stylesheet and javascript is not optimal for a production site. For production use, we recommend caching the output of these requests and serving them as static files, either individually or as part of a larger collection of concatenated CSS or JavaScript.

Disable Carrington Build Styles

/**
 * Remove default Carrington Build styles,
 */
function cfct_dequeue_build_styles() {
	wp_dequeue_style('cfct-build-css');
}
add_action('wp_enqueue_scripts', 'cfct_dequeue_build_styles', 999);

 

And the same can be done for the scripts by using wp_dequeue_script('cfct-build-js').

Please see the module template included in Carrington Build for more on adding custom styles and scripts for a Module.

And please see more on how to disable the default Carrington Build styles.

In summary:

  1. Use the request handlers to add styles and scripts dynamically while in development
  2. When ready, save the output of each as a file or add to an existing JavaScript or CSS asset file
  3. Dequeue the dynamic styles using the code above
  4. If necessary, enqueue the new file you may have created in Step 2

See also:

Back to Carrington Build

These sections are available to the public. The remaining sections are available exclusively to customers.