markjaquith / WordPress-Skeleton

Basic layout of a WordPress Git repository. I use this as a base when creating a new repo.
1.85k stars 598 forks source link

'/content' directory not found beside '/wp' directory (get_template_directory_uri) #119

Closed jonhtyler closed 5 years ago

jonhtyler commented 5 years ago

I am trying to understand why this is not working.

I cloned the WordPress-Skeleton project and began to set things up. I have the directory structure like:

/wpdevelopment |/content |/themes |/testtheme |/css functions.php header.php |/wp wp-config.php

(shortened for brevity)

In the functions.php file, I have the enqueue scripts that is supposed to get by css files. In that enqueue function, I am using the get_template_directory_uri() function which returns "http://www.wpdev.local/content/themes/testtheme/css/testtheme.css". The problem is that the actual path is /wp_development/content/themes/testtheme... as shown above.

The problem is development vs "prod" scenario. When I work in dev on my local machine, the directory structure is like above. When I work on a new project, "wp_development" will become my new project name (e.g. /WidgetInc or /NonProfitGroup). However, when I publish to a web host, it will be deployed one level deeper.

How can I get the get_template_directory_uri function to return the proper path to the css files?

For the record, WordPress does see the theme in the /content folder outside of the /wp folder and can be activated. The problem that I don't understand is why I can't get the pathing to work to find the support files where I need them to be.

Thanks

jonhtyler commented 5 years ago

I believe I have found the answer. In wp-config.php, I was changing the wp_content_dir instead of the wp_content_url. It seems to be working now.