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.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityFor 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
file
Put inside <head>
tag,
<css src="css/styles.css"/>
<script src="js/custom.js"/>
Add your css file inside,
app/design/frontend/{Vendor}/{theme}/web/css/styles.css
Add your custom js
app/design/frontend/{Vendor}/{theme}/web/js/custom.js
Remove cache folder and try.
Its now working in all pages of site.
php bin/magento setup:static-content:deploy
did you deploy content? – Qaisar Satti Feb 17 '16 at 10:33