Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move "WordPress files" to a subdirectory #103

Merged
merged 7 commits into from
Jul 27, 2020

Conversation

szepeviktor
Copy link
Contributor

Closes #102

@jarednova :)

@szepeviktor szepeviktor changed the title Feature/subdir Move "WordPress files" to a subdirectory Jun 3, 2020
@szepeviktor
Copy link
Contributor Author

Nice outlook :)

kép

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Jun 3, 2020

That "template" and "templates" bothers me.
Please advise.

@gchtr
Copy link
Member

gchtr commented Jun 25, 2020

It’s funny that somebody asked how to do this just yesterday on Stack Overflow.

I would propose a structure like this.

.
└── wp-content/themes/starter-theme/
    ├── bin/
    ├── src/
    │   └── StarterSite.php
    ├── static/
    ├── tests/
    ├── theme/
    │   ├── archive.php
    │   ├── author.php
    │   ├── footer.php
    │   ├── functions.php
    │   ├── header.php
    │   ├── index.php
    │   ├── page.php
    │   ├── search.php
    │   ├── single.php
    │   ├── screenshot.png
    │   └── style.css
    ├── views/
    ├── .gitignore
    ├── .travis.yml
    ├── LICENSE
    ├── composer.json
    ├── humans.txt
    ├── phpunit.xml
    └── README.md

(Edit here)

  • I’d call the template subfolder theme, because that folder would contain all the files that are typical to a WordPress theme. But I guess templates would work too.
  • As proposed by @szepeviktor in Secret WordPress core feature: subdirectory learn-timber-theme#1 (comment), classes could be placed in the src folder and not in functions.php. Autoloading could be handled with Composer.
  • As @davidhund proposed in Breakthrough in theme structure! #102 (comment), we could rename the folder that contains the Twig files from templates to views and use the term "template" for WordPress/PHP template files. We also often use the term "view" throughout the documentation. Yes it’s called "Twig template engine", but it’s also called "[WordPress Template Hierarchy](WordPress Template Hierarchy)".

@szepeviktor
Copy link
Contributor Author

It’s funny that somebody asked how to do this just yesterday on Stack Overflow.

Is he a clone of me?? 🙄

@szepeviktor
Copy link
Contributor Author

I would propose a structure like this.

I agree with theme/ and views/

@jarednova jarednova merged commit 37fe919 into timber:master Jul 27, 2020
@szepeviktor
Copy link
Contributor Author

Thank you for the fix.

@szepeviktor szepeviktor deleted the feature/subdir branch July 27, 2020 14:36
@szepeviktor
Copy link
Contributor Author

@jarednova Could you give me a proper English sentence to add to What's here? section of the README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breakthrough in theme structure!
3 participants