{"id":54454,"date":"2025-06-09T10:15:29","date_gmt":"2025-06-09T10:15:29","guid":{"rendered":"https:\/\/bookwormhead.com\/?p=54454"},"modified":"2025-06-09T10:22:54","modified_gmt":"2025-06-09T10:22:54","slug":"headless-cms-wordpress-sage","status":"publish","type":"post","link":"https:\/\/bookwormhead.com\/cms\/headless-cms-wordpress-sage\/","title":{"rendered":"Best Headless CMS Wordpres: How To Install Sage Theme &#8211; 100% Working"},"content":{"rendered":"<p>If you\u2019ve ever tried setting up Sage 10 with Acorn and Vite and felt like you were losing your mind, you&#8217;re not alone.<\/p>\n<p>I recently went through the whole mess too \u2014 broken themes, missing PHP extensions, Vite build errors, and Acorn refusing to behave. So here\u2019s the real-world setup guide I wish someone handed me at the start.<\/p>\n<p>This article is based on real-world debugging, not just the happy-path setup instructions. Here&#8217;s what worked for me \u2014 and what I wish I knew at the start.<\/p>\n<h2>Step 1: Fix your PHP setup first<\/h2>\n<p>The #1 issue that\u2019ll break your install is a missing PHP extension. You\u2019ll usually get errors like: <span style=\"color: #ff0000;\"><em>league\/flysystem-local requires ext-fileinfo<\/em><\/span><\/p>\n<p>That\u2019s because your php.ini doesn\u2019t have fileinfo enabled \u2014 and yes, it needs to be the actual php.ini file, not php.ini-development or php.ini-production.<\/p>\n<h3>Configurate the .php.ini<\/h3>\n<p>Run php &#8211;ini in your terminal or you can usually find this on C:\\Program Files\\PHP\\php.ini . Please make sure that you are updating the right .php.ini because they have both production and development. Then open that file and make sure this line is uncommented then restart your terminal or web server<br \/>\n[code_block] extension=php_fileinfo.dll [\/code_block]<\/p>\n<h2>Step 2. Install Acorn 5.0.3 before Sage (Recommend if you run other than Sage)<\/h2>\n<p>Do this before installing Sage, or things will break later. Acorn is the engine behind Sage\u2019s Laravel-style functionality (like Blade and the container).<\/p>\n<p>[code_block]<br \/>\ncomposer require roots\/acorn:^5.0.3 &#8211;with-all-dependencies<br \/>\n[\/code_block]<\/p>\n<p>This can be run in your main Bedrock app, or even just to verify your system dependencies and PHP are ready. It&#8217;s useful for:<\/p>\n<ul>\n<li>Checking for any global conflicts (like fileinfo, illuminate\/*, etc.)<\/li>\n<li>Testing if your PHP setup supports Acorn<\/li>\n<li>Think of this like testing your car engine before going on a road trip.<\/li>\n<\/ul>\n<h2>Step 3: Create a new Sage theme (and install Acorn inside it too)<\/h2>\n<p>[code_block]<br \/>\ncomposer create-project roots\/sage your-theme-name<br \/>\ncd your-theme-name<br \/>\n[\/code_block]<\/p>\n<p>[code_block]<br \/>\ncomposer require roots\/acorn:^5.0.3 &#8211;with-all-dependencies<br \/>\n[\/code_block]<\/p>\n<h2>Step 4: Run Vite build (this will save you from 500 errors)<\/h2>\n<p>Now your theme\u2019s code is set up, but the browser doesn\u2019t know what to do with the JS and CSS until you compile it.<\/p>\n<p>Run the following command inside the Sage theme<br \/>\n[code_block]<br \/>\nnpm install<br \/>\nnpm run build<br \/>\n[\/code_block]<\/p>\n<p>This will generate your assets in:<br \/>\n[code_block] \/public\/build\/manifest.json [\/code_block]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve ever tried setting up Sage 10 with Acorn and Vite and felt like you were losing your mind, you&#8217;re not alone. I recently went through the whole mess too \u2014 broken themes, missing PHP extensions, Vite build errors, and Acorn refusing to behave. So here\u2019s the real-world setup guide I wish someone handed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,161],"tags":[74],"class_list":["post-54454","post","type-post","status-publish","format-standard","hentry","category-cms","category-front-end","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/posts\/54454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/comments?post=54454"}],"version-history":[{"count":20,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/posts\/54454\/revisions"}],"predecessor-version":[{"id":54474,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/posts\/54454\/revisions\/54474"}],"wp:attachment":[{"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/media?parent=54454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/categories?post=54454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/tags?post=54454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}