2

Currently my folder structure looks something like

...\themes\MyTheme
  - \lib
  - \src
  - index.php
  - style.css
  - more theme files
  - .gitignore
  - README.md
  - many other non-Wordpress files

I'd like to change it into something more like

...\themes\MyTheme
  - \lib
  - \src
  - \wp - Pretty much all my theme's .php files
  - .gitignore
  - README.md
  - many other non-Wordpress files
  • Remember the index.php, functions.php and styles.css should be in your themes directory. Than you can change the files. – Kvvaradha Dec 13 '15 at 2:50
0

The answer is yes. Like @Kvvaradha mentioned in his comments. If you put

header.php
footer.php
index.php
functions.php
style.css

must be in /wp-content/themes/your-theme-folder. And other your library, components and includes could be put anywhere that you prefer. But, make sure files and folders structure are flexible. Good luck in your codes :)

  • The question was "can I put all my theme files in some other directory?" and your answer is no, not yes as you write. sorry for being pedantic here. – Mark Kaplun Dec 13 '15 at 7:19
  • Also, sidebar.php is mandatory (throws notice) and also comments.php etc. How do you manage these files? get_footer / get_header etc. can be replaced by get_template_part('wp_stuff/header'); so you don't have to have them in root I guess ... – trainoasis May 11 '16 at 9:28
  • @trainoasis Thanks for your point out. I just need to check again. – por May 11 '16 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.