I am trying to include custom css and js in custom theme and should come on all pages.
I have tried this from the Magento DevDocs, but I can't make it right and it's not showing. Please help me.
cssjavascriptlayoutmagento2theme
I am trying to include custom css and js in custom theme and should come on all pages.
I have tried this from the Magento DevDocs, but I can't make it right and it's not showing. Please help me.
Best Answer
For keep css and js in all pages you have to customize
default_head_blocks.xml
file. set file,magento2/app/design/frontend/{Vendor}/{themename}/Magento_Theme/layout/default_head_blocks.xml
filePut inside
<head>
tag,Add your css file inside,
Add your custom js
Remove cache folder and try.
Its now working in all pages of site.