Currently my folder structure looks something like

  - \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

  - \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, 2015 at 2:50

1 Answer 1


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


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. Dec 13, 2015 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, 2016 at 9:28
  • @trainoasis Thanks for your point out. I just need to check again.
    – Por
    May 11, 2016 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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