I wanted to develop a theme using Sage, Acorn and symbolic links (ln -s PATH TARGET) to link the actual theme directory located in a different folder to the wp-content/themes directory (I'm not using bedrock, but i think this also applies there).
The theme should successfully load but it did not.
I resolved the issue by switching from a symbolic link to copying the theme inside of wp-content/themes but this is not a real fix and degrades the development experience and possibility to keep the theme's source separate of wordpress (e.g. no easy re-use on multiple wordpress installs)
What actually happens?
The theme did not load successfully and threw error:
InvalidArgumentException:
Unrecognized extension in file: /home/admin/htdocs/wpress.
at /home/admin/dev/sage-theme/vendor/illuminate/view/Factory.php:305
at Illuminate\View\Factory->getEngineFromPath('/home/admin/htdocs/wpress')
(/home/admin/dev/sage-theme/vendor/illuminate/view/Factory.php:274)
at Illuminate\View\Factory->viewInstance('/home/admin/htdocs/wpress', '/home/admin/htdocs/wpress', array())
(/home/admin/dev/sage-theme/vendor/illuminate/view/Factory.php:122)
at Illuminate\View\Factory->file('/home/admin/htdocs/wpress', array(), array())
(/home/admin/dev/sage-theme/vendor/roots/acorn/src/Roots/helpers.php:99)
at Roots\view('/home/admin/htdocs/wpress', array())
(/home/admin/dev/sage-theme/vendor/roots/acorn/src/Roots/globals.php:13)
at view('/home/admin/htdocs/wpress', array())
(/home/admin/dev/sage-theme/index.php:14)
at include('/home/admin/dev/sage-theme/index.php')
(/home/admin/htdocs/wpress/wp-includes/template-loader.php:106)
at require_once('/home/admin/htdocs/wpress/wp-includes/template-loader.php')
(/home/admin/htdocs/wpress/wp-blog-header.php:19)
at require('/home/admin/htdocs/wpress/wp-blog-header.php')
(/home/admin/htdocs/wpress/index.php:17)
Steps to reproduce
Break:
Create a new Sage project in some other location than the WordPress install
Install Acorn, build assets...
Create a symbolic link from the sage project's directory to the Wordpress install
Activate the theme, go to the frontend and watch the chaos unfold
Temp-Fix:
Remove symbolic link to the sage project
Copy the files from the sage project to the WordPress install
Now everything works fine, but this is not really a solution
System info
Ubuntu Server 22.04 (happens on any other Linux / Unix / macOS, so it's platform independent)
Wordpress optimized LAMP-Stack (not trellis) with Apache HTTPD and PHP FPM
Version
10.6.0
What did you expect to happen?
I wanted to develop a theme using Sage, Acorn and symbolic links (
ln -s PATH TARGET
) to link the actual theme directory located in a different folder to the wp-content/themes directory (I'm not using bedrock, but i think this also applies there).The theme should successfully load but it did not.
I resolved the issue by switching from a symbolic link to copying the theme inside of wp-content/themes but this is not a real fix and degrades the development experience and possibility to keep the theme's source separate of wordpress (e.g. no easy re-use on multiple wordpress installs)
What actually happens?
The theme did not load successfully and threw error:
Steps to reproduce
Break:
Temp-Fix:
System info
Ubuntu Server 22.04 (happens on any other Linux / Unix / macOS, so it's platform independent) Wordpress optimized LAMP-Stack (not trellis) with Apache HTTPD and PHP FPM
Log output
No response
Please confirm this isn't a support request.
Yes