WP Emerge Theme Logo

Packagist Gitter

A modern WordPress starter theme which uses the WP Emerge framework.

This is the WP Emerge Theme project - for the WP Emerge framework please check out https://github.com/htmlburger/wpemerge.

Summary

Documentation

https://docs.theme.wpemerge.com/

https://docs.theme.wpemerge.com/quickstart.html

Development Team

Brought to you by Atanas Angelov and the lovely folks at htmlBurger.

Comparison Table

WP Emerge Theme Sage Timber
View Engine PHP, Blade, Twig, any Blade Twig
Routing
MVC ✖✔✔ ✖✔✖¹ ✖✔✖
Middleware
View Composers ✔/✖²
Service Container
Stylesheets SASS + PostCSS SASS + PostCSS N/A³
JavaScript ES6 ES6 N/A³
Front end, Admin, Editor and Login Bundles N/A³
Automatic Sprite Generation N/A³
Cache Breaker
WPCS Linting
Advanced Error Reporting
WP Unit Tests for your classes

¹ Sage's Controller is more of a View Composer than a Controller.

² Sage's Controller provides similar functionality but is limited to 1 composer (controller) per view and vice versa.

³ Timber does not provide a front-end build process so you can implement whatever you prefer.

Email any factual inaccuracies to atanas.angelov.dev@gmail.com so they can be corrected.

Features

  • All features from WP Emerge:
    • Routes with optional rewrite rule integration
    • Controllers
    • Middleware
    • PSR-7 Responses
    • View Composers
    • Service Container
    • Service Providers
    • PHP view layouts (a.k.a. automatic wrapping)
    • Support for PHP, Blade 5.4 and/or Twig 2 for views
  • Gutenberg support.
  • SASS + PostCSS for stylesheets. Separate bundles are created for front-end, administration, Gutenberg and login pages.
  • ES6 for JavaScript. Separate bundles are created for front-end, administration, Gutenberg and login pages.
  • Webpack to transpile and bundle assets, create sprites, optimize images etc.
  • Browsersync for synchronized browser development.
  • Autoloading for all classes in your App\ namespace.
  • Automatic, fool-proof style and script cache breaker.
  • WPCS, JavaScript and SASS linting using single yarn commands.
  • Single-command optional CSS package installation:
    • Boostrap 4
    • Bulma
    • Foundation
    • Tachyons
    • FontAwesome
  • WP Unit Test scaffolding for your own classes.

Requirements

Directory structure

wp-content/themes/your-theme
├── app/
│   ├── helpers/              # Helper files, add your own here as well.
│   ├── setup/                # Register WordPress menus, post types etc.
│   │   ├── menus.php
│   │   ├── post-types.php
│   │   ├── sidebars.php
│   │   ├── taxonomies.php
│   │   ├── theme-support.php
│   │   └── widgets.php
│   ├── src/                  # PSR-4 autoloaded classes.
│   │   ├── Controllers/      # Controller classes for WP Emerge routes.
│   │   ├── Widgets/          # Widget classes.
│   │   └── ...
│   ├── config.php            # WP Emerge configuration.
│   ├── helpers.php           # Require your helper files here.
│   ├── hooks.php             # Register your actions and filters here.
│   └── framework.php         # Register your WP Emerge routes, globals etc.
├── dist/                     # Bundles, optimized images etc.
├── languages/                # Language files.
├── resources/
│   ├── build/                # Build process configuration.
│   ├── fonts/
│   ├── images/
│   ├── scripts/
│   │   ├── admin/            # Administration scripts.
│   │   ├── editor/           # Gutenberg editor scripts.
│   │   ├── login/            # Login scripts.
│   │   └── theme/            # Front-end scripts.
│   ├── styles/
│   │   ├── admin/            # Administration styles.
│   │   ├── editor/           # Gutenberg editor styles.
│   │   ├── login/            # Login styles.
│   │   ├── shared/           # Shared styles.
│   │   └── theme/            # Front-end styles.
│   └── vendor/               # Any third-party, non-npm assets.
├── theme/                    # Required theme files and views
│   ├── partials/             # View partials.
│   ├── templates/            # Page templates.
│   ├── functions.php         # Bootstrap theme.
│   ├── screenshot.png        # Theme screenshot.
│   ├── style.css             # Theme stylesheet (avoid adding css here).
│   └── [index.php ...]
├── vendor/                   # Composer packages.
├── README.md                 # Your theme README.
└── ...

Notable directories

app/helpers/

Add PHP helper files here. Helper files should include function definitions only. See below for information on where to put actions, filters, classes etc.

app/setup/

Modify files here according to your needs. These files should contain registrations and declarations of WordPress entities only such as post types, taxonomies etc.

app/src/

Add PHP class files here. All clases in the App\ namespace are autoloaded in accordance with the PSR-4 standard.

resources/images/

Add images for styling here. Optimized copies will be placed in dist/images/ when running the build process.

resources/styles/theme/

Add .css and .scss files to add them to the front-end bundle. Don't forget to @import them in index.scss.

resources/styles/[admin,editor,login]/

These directories are for the admin, editor and login bundles, respectively. They work identically to the main resources/styles/theme/ directory.

resources/scripts/theme/

Add JavaScript files here to add them to the front-end bundle. The entry point is index.js.

resources/scripts/[admin,editor,login]/

These directories are for the admin, editor and login bundles, respectively. They work identically to the main resources/scripts/theme/ directory.

theme/

Add views in this, the theme/partials/ or the theme/templates/ directories accordingly. Avoid adding any PHP logic here, unless it pertains to layouting (PHP logic should go into helper files or WP Emerge controllers)

Contributing

WP Emerge Theme is completely open source and we encourage everybody to participate by:

results matching ""

    No results matching ""