wesleytodd / YeoPress

A Yeoman generator for WordPress
Other
1.08k stars 161 forks source link

Wordpress says that no themes are installed #42

Closed mattymess closed 10 years ago

mattymess commented 10 years ago

I'm using wordpress locally for development at some url. Let's call it 'website.dev', which is on port 8080 served by MAMP.

In wp-config, I have

/**
 * Set custom paths
 *
 * These are required because wordpress is installed in a subdirectory.
 */
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . ':8080/wp');
define('WP_HOME',    'http://' . $_SERVER['SERVER_NAME'] . ':8080');
define('WP_CONTENT_DIR', __dir__ . '/content');
define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . ':8080/content');

My folder structure also matches this, and yet Wordpress is telling me I have no themes. I verified that I have all the default themes in /content/themes

Did I miss something??

wesleytodd commented 10 years ago

That all looks right as far as I can tell. Although I have not tested with MAMP. I guess it is possible that the line with __dir__ is not evaluating correctly. Maybe you can try var_dumping that and make sure it is correct.

Also, maybe you can try using vagrant and see if you get the same issue. Also, I would recommend using vagrant anyway because it is just better..wink wink.

wesleytodd commented 10 years ago

Also make sure to check your file permissions, that could cause them to not appear as well, if they were not owned by the right user.

mattymess commented 10 years ago

Will try these suggestions as soon as I get back to this project and let you know how it goes.

furins commented 10 years ago

I had the same issue (on MAMP, PHP 5.2) and I solved it replacing

define('WP_CONTENT_DIR', __dir__ . '/content');

with

define('WP_CONTENT_DIR', dirname(__FILE__) . '/content');

since it seems that __dir__ is available only for PHP >= 5.3 (http://php.net/manual/en/language.constants.predefined.php). Hope it helps!

wesleytodd commented 10 years ago

Awesome, thanks @furins. I guess we could consider changing that for backward compat. Maybe you could put it in a PR?