Symlink a directory to wp-content/themes

Is it possible to symlink a directory from my project folder to my wp-content/themes folder which is in a Vagrant setup called chassis: https://github.com/Chassis/Chassis ?

I tried to symlink already using ln -s, but my wordpress installation did not recognize it as I did not see it in the Appearance > Themes admin panel. I'm wondering if it's possible to do what I want to do. I'm assuming this is done all the time, but why isn't it working for me?

Topic vagrant theme-development themes Wordpress

Category Web


Please make sure that your "style.css" should be in the root folder. If it's not then, the same theme will not visible in the setting along with you can not see any custom attributes in the backend.

So, make sure "style.css" should be in the root theme folder.


You can add this to your VagrantFile for "shared folders:"

config.vm.synced_folder "/path/to/your/host/projectfolder/theme", 
    "/path/to/your/vagrant/wp-content/theme", 
    owner: 'www-data', 
    group: 'www-data', 
    mount_options: ["dmode=775", "fmode=664"]

http://docs.vagrantup.com/v2/synced-folders/basic_usage.html


Yes, symlinks also possible. But maybe you have a problem with the rights of the wp install. Often have the user of the install, like www, not enough rights for the path from your symlink. The user of the WP install must read inside the custom theme folder, important at first is the style.css, created with your user.

Try this:

chmod 777 /Users/Sam/Projects/SomeTheme
find /Users/Sam/Projects/SomeTheme/ -type f | xargs -I {} chmod 644 {}
find /Users/Sam/Projects/SomeTheme/ -type d | xargs -I {} chmod 755 {}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.