A simple and modern WordPress starter theme that doesn't make any assumptions about the technology you use.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
lib
templates
.editorconfig
.eslintrc
.gitignore
404.php
README.md
composer.json
footer.php
functions.php
gulpfile.js
header.php
index.php
package.json
page.php
screenshot.png
search.php
single.php
style.css

README.md

Rye.

You can put lipstick on a pig, but it's still a pig.

(pig: WordPress, lipstick: Starter themes)

We created Rye because there are times when we need to build high performing applications with a WordPress backend. When we do this, we don't want several layers of abstraction existing simply to help the majority of developers.

What Rye does:

  1. Isolates the boilerplate code you need to write to one place.
  2. Gives you a simple and modern/psr-4-ready file architecture to start with.

What Rye does not:

  • Try to make you buy stuff.
  • Add too many layers of abstraction.
  • Add dependencies (except for composer - which you can strip if you want).
  • Override default WP conventions. WP methods will always remain true.

Getting started.

Please make sure you have npm and gulp installed globally.

  1. Download and add this project as a theme in your WP installation. Rename the directory to something relevant.
  2. npm install and composer install so the gulp plugins will be installed.
  3. Edit the package.json file. The project name will be used to set the name for the compiled asset files.
  4. Configure the configuration array in init.php.
  5. Add custom theme-specifc logic to lib/Rye/Grain.php.
  6. Add any other classes and namespaces to this directory.
  7. Develop your styles using gulp watch.

Running gulp at any time will build your assets. For convience, run gulp watch and your files will be compiled automatically as you edit them.

Rye globals.

  • Rye The Rye class. Not much to do here. It's the "core".
  • Grain A good place to add helper/utility methods. Can be later accessed like Rye\Rye::$grain->myMethod().
  • Rye::$grain The Grain singleton reference. This gets instantiated in Rye's init.
  • Rye::package() The package.json file as a php object.
  • Rye::projectName() Returns sanitized name specified in the package.json file.
  • Rye::$enviornment A static property which tells Rye which enviornment to run in. This is in the functions.php file for you. It can be assigned to 1 of 4 constants; Rye::TESTING, Rye::DEVELOPMENT, Rye::STAGING, or Rye::PRODUCTION.
  • Rye::stylesheet() Outputs style tags using the appropriate css file based on the enviornment property.

Project architecture.

  • lib/ Put any other custom classes you may need and configure the init.php file.
  • templates/ A place to put partials and custom templates.
  • style.css This shouldn't be used. It's only required to specify information about the theme for WordPress.
  • assets/css Any css or pre-processor css file such as .styl or .less files should be included here. The main entry file should be called app.(type).
  • assets/js App specific JavaScripts should be added here. After Grunting thing will compiled into assets/dist.
  • assets/js/vendor These files don't get compiled/minified after gulping. They should be specified in the functions.php file (in the Rye config array) so WordPress is aware of them. This will eliminate any chance of duplicate libraries being added after installing plugins.

Plugin recommendations for doing things.