Last active
August 21, 2020 06:23
-
-
Save andreibabor/3cbc0cc946cb09d6112ddc244d3fd541 to your computer and use it in GitHub Desktop.
Wordpress: how insert other js, css files in sage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Important: putem instal asa: bower install Chart.js --save. | |
sau pasii mai jos: | |
1.modifam assets/manifest.json iar la linia 22 punem codul | |
"slick-carousel.js": { | |
"files": ["../bower_components/slick-carousel/slick/slick.js"], | |
"main": true | |
}, | |
"slick-carousel.css": { | |
"files": ["../bower_components/slick-carousel/slick/slick.css"], | |
"main": true | |
}, | |
2.in bower.json bagam codul asta | |
"slick-carousel": { | |
"main": [ | |
"./scss/slick.scss", | |
"./dist/js/slick.js" | |
] | |
} | |
3.dupa care Open up lib/setup.php iar dupa main.js si adaugam | |
wp_enqueue_style('sage/slick-carousel', Assets\asset_path('styles/slick-carousel.css'), false, null); | |
wp_enqueue_script('sage/slick-carousel.js', Assets\asset_path('scripts/slick-carousel.js'), ['jquery'], null, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bower uninstall PACKAGENAME --save -> remove bower package