{"id":221,"date":"2020-04-22T06:24:33","date_gmt":"2020-04-22T06:24:33","guid":{"rendered":"https:\/\/localhost\/bricksacademy\/?post_type=bricks_article&p=221"},"modified":"2024-03-07T14:14:53","modified_gmt":"2024-03-07T14:14:53","slug":"child-theme","status":"publish","type":"bricks_article","link":"https:\/\/academy.bricksbuilder.io\/article\/child-theme\/","title":{"rendered":"Child Theme"},"content":{"rendered":"\n
Please do not\u00a0edit any of the Bricks theme core files directly, as updating the theme will cause all your changes to be lost.\u00a0<\/p>\n\n\n\n
Instead, use the Bricks child theme to make modifications and overwrite files. You can download the Bricks child theme directly from your Bricks account<\/a>.<\/p>\n\n\n\n Upload this child theme ZIP file (bricks-child.zip) like any other WordPress theme. Go to Appearance \u2192 Themes<\/strong> and activate Bricks Child Theme<\/strong>. You can add your own styles to style.css<\/strong>.<\/p>\n\n\n\n In order to load your files only on the front end & the canvas and not in the builder panel (as your custom CSS might affect the builder), you have to check against How To Enqueue Scripts (JS) & Styles (CSS)<\/h2>\n\n\n\n
bricks_is_builder_main()<\/code> like this:<\/p>\n\n\n\n
add_action( 'wp_enqueue_scripts', function() {\n \/\/ Code & check below enqueues your files on the canvas & frontend, not the builder panel. Otherwise custom CSS might affect builder)\n if ( ! bricks_is_builder_main() ) {\n wp_enqueue_style( 'bricks-child', get_stylesheet_uri(), ['bricks-frontend'], filemtime( get_stylesheet_directory() . '\/style.css' ) );\n }\n} );<\/code><\/pre>\n\n\n\n