SlideShare a Scribd company logo
Building Progressive Themes
with WP Rig
Morten Rand-Hendriksen
WPCampus 2019
The web has evolved
Performance
Accessibility
Build tools
Unit testing
Progressive ES2015
CSS Next
WordPress is lagging behind
PHP CSS JavaScript
WordPress powers +34% of the web.
WordPress powers +34% of the web.
Unless WordPress stays current,
it will hold 34% of the web back!
How do we move WordPress,
and through it the web
forward?
CC Gordon Joly https://goo.gl/iuRrDa
Desire Path
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Pave the cowpath
To formalize an existing de-facto practice.
WordPress
Performance
Accessibility
Build tools
Unit testing
Progressive ES2015
CSS Next
✓
⨯
Things I have control over:
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
• How do I Sass?
• What kind of build process makes
me the cool?
• Can I Gulp the Grunt WebPack?
• Will Composer even?
• Is Yarn Homebrew, or do I need a
Gem to Borwserify the Docker?
Build process Starter theme
Build process
• Modern JavaScript (ES2015)
• Modern CSS (custom properties,
modules, etc)
• WordPress Coding Standards
• Code linting for PHP, JS, and CSS
• Automatic internationalization
• Code and asset optimization
Starter theme
• Accessible
• Modern best-practices
• Styled out of the box
• Minimum required files
• Optional templates
• Progressive features including AMP support
• Gutenberg, Gutenberg, Gutenberg
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
WP Rig Contributors
The WP Rig Philosophy
WP Rig does the heavy lifting so you
can focus on what you do best:
Build themes using modern PHP,
CSS, and JavaScript.
WP Rig is your rig
Once downloaded, WP Rig becomes
your rig — a unique custom theme
development rig living in your
development environment.
What WP Rig does: PHP
• Watches PHP files.
• Checks PHP against WordPress Coding Standards.
• Alerts for errors during build.
• Can integrate with the code editor for in-editor alerts 

(requires extensions).
• Creates translation files for production.
What WP Rig does: CSS
• Watches CSS files.
• Processes CSS through PostCSS (Autoprefixer, postcss_preset_env,
etc).
• Lints CSS to WordPress Coding Standards using Stylelint.
• Can integrate with the code editor for in-editor alerts 

(requires extensions).
• Minifies CSS for production.
What WP Rig does: JavaScript
• Watches JavaScript files
• Lints JavaScript to to WordPress Coding Standards using ESlint.
• Can integrate with the code editor for in-editor alerts (requires
extensions).
• Processes ES2015 through Babel.
• Uglifies JavaScript for production.
Starter theme features
• Accessible drop-down menu.
• Modern CSS layouts (Grid, Flexbox, etc).
• Modern JavaScript loading (async/defer).
• Optimized Google Fonts loading.
• Lazy-loading images.
• AMP-ready.
Starter theme features
• Modular in-body CSS loading.
• Plug-and-play template hierarchy files.
• Object-Oriented PHP.
• Modern CSS (custom properties etc).
• Modern JavaScript (ES2015)
4
Building the next generation of themes with WP Rig 2.0
https
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
WP Rig helps you build modern themes.
Modern themes move the web forward.
The Workshop™©®
The Workshop™©®
1. WP Rig, an introduction
2. Setup and configuration
3. Styling WP Rig themes
4. A pinch of JavaScript
5. Modern PHP in WordPress themes
6. Two deep-dive examples
✓
Setup and Configuration
Building the next generation of themes with WP Rig 2.0
Using WP Rig:
1. Set up your regular WordPress development environment.
2. Clone / copy WP Rig into the themes folder.
3. In terminal, run npm run rig-init
4. Set up config/config.json
5. In terminal, run npm run dev
6. Start developing
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
npm run rig-init
npm install
./config/config.json
https
npm run generateCert
Building the next generation of themes with WP Rig 2.0
✓ ✓ ✓ 😴
Building the next generation of themes with WP Rig 2.0
Using WP Rig:
1. Set up your regular WordPress development environment.
2. Clone / copy WP Rig into the themes folder.
3. In terminal, run npm run rig-init
4. Set up config/config.json
5. In terminal, run npm run dev
6. Start developing
✓
✓
✓
✓
👉
npm run dev
npm run build
npm run bundle
The Workshop™©®
1. WP Rig, an introduction
2. Setup and configuration
3. Styling WP Rig themes
4. A pinch of JavaScript
5. Modern PHP in WordPress themes
6. Two deep-dive examples
✓
✓
👉
The WP Rig Philosophy
WP Rig does the heavy lifting so you
can focus on what you do best:
Build themes using modern PHP,
CSS, and JavaScript.
What WP Rig does: CSS
• Watches CSS files.
• Processes CSS through PostCSS (Autoprefixer, postcss_preset_env,
etc).
• Lints CSS to WordPress Coding Standards using Stylelint.
• Can integrate with the code editor for in-editor alerts 

(requires extensions).
• Minifies CSS for production.
./assets/css/src/*.css
Building the next generation of themes with WP Rig 2.0
Primary stylesheet - always loaded
Theme stylesheets
Partials called using @import
Building the next generation of themes with WP Rig 2.0
Layouts with flex and grid
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
CSS Custom Properties (variables)
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Google Fonts
preconnect
preload
optimized
✓
✓
✓
Building the next generation of themes with WP Rig 2.0
The WP Rig Philosophy
WP Rig does the heavy lifting so you
can focus on what you do best:
Build themes using modern PHP,
CSS, and JavaScript.
CSS in WP Rig
Component-level stylesheets,
loaded progressively inside the
<body> element via template files.
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
The Workshop™©®
1. WP Rig, an introduction
2. Setup and configuration
3. Styling WP Rig themes
4. A pinch of JavaScript
5. Modern PHP in WordPress themes
6. Two deep-dive examples
✓
✓
✓
👉
async
defer
Script download
Script execution
<script>
<script async>
<script defer>
HTML parse
Parse paused
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
The WP Rig Philosophy
WP Rig does the heavy lifting so you
can focus on what you do best:
Build themes using modern PHP,
CSS, and JavaScript.
The Workshop™©®
1. WP Rig, an introduction
2. Setup and configuration
3. Styling WP Rig themes
4. A pinch of JavaScript
5. Modern PHP in WordPress themes
6. Two deep-dive examples
✓
✓
✓
👉
✓
Classes
Components
Namespaces
Modern architecture
No more WordPress PHP shenanigans
Building the next generation of themes with WP Rig 2.0
PHP in WP Rig
• Templates work as they always have.
• Core template functions work as they always have.
• index.php is the base template for every view.
• Template parts live in ./template-parts/
• ./optional/ folder has optional drag-and-drop template files.
• Custom functions are called using

wp_rig()->function_name();
The Workshop™©®
1. WP Rig, an introduction
2. Setup and configuration
3. Styling WP Rig themes
4. A pinch of JavaScript
5. Modern PHP in WordPress themes
6. Two deep-dive examples
✓
✓
✓
👉
✓
✓
The Workshop™©®
1. WP Rig, an introduction
2. Setup and configuration
3. Styling WP Rig themes
4. Modern PHP in WordPress themes
5. A pinch of JavaScript
6. Two deep-dive examples
✓
✓
✓
✓
✓
✓
wprig.io
More info and training:
linkedin.com/learning
More info and training:
github.com/wprig/wprig
Contribute to WP Rig and make it yours:
Lykke til!

More Related Content

PDF
How to Build Custom WordPress Blocks
PDF
CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017
PDF
Web Design Primer Sample - HTML CSS JS
PDF
Rapid WordPress theme development
PDF
WordCamp Birmingham 2015 - Theme building tricks of the trade
PDF
WordCamp Sheffield 2014 Theme Workflow Presentation
PDF
WordCamp Bournemouth 2014 - Designing with data in WordPress
PDF
Zurb foundation
How to Build Custom WordPress Blocks
CSS Grid Changes Everything - Keynote at WebCamp Zagreb 2017
Web Design Primer Sample - HTML CSS JS
Rapid WordPress theme development
WordCamp Birmingham 2015 - Theme building tricks of the trade
WordCamp Sheffield 2014 Theme Workflow Presentation
WordCamp Bournemouth 2014 - Designing with data in WordPress
Zurb foundation

What's hot (20)

PDF
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
PDF
Responsive Web Design Tutorial PDF for Beginners
PPTX
Word press development for non developers
PPTX
Untangling spring week1
PDF
10 Cool Things You Can Do with Widgets
PPTX
Learn Bootstrap 4
PDF
Rapid Prototyping with Sass, Compass and Middleman by Bermon Painter
PDF
Introduce Bootstrap 3 to Develop Responsive Design Application
PDF
光速テーマ開発のコツ
PPTX
Introduction To WordPress
PDF
Front-End Frameworks: a quick overview
PPTX
Untangling spring week8
PDF
Best Friend || Worst Enemy: WordPress Multisite
PDF
Bootstrap Framework and Drupal
PPTX
Untangling spring week10
PDF
Advanced custom fields in Wordpress
PDF
Agile Wordpress
PPTX
Building a Moodle theme with bootstrap
PDF
Create Custom Page Builders with Gutenberg and ACF Blocks
PPTX
Elastic: Why WYSIWYG is the future of WordPress themes — WordCamp NYC 2009
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
Responsive Web Design Tutorial PDF for Beginners
Word press development for non developers
Untangling spring week1
10 Cool Things You Can Do with Widgets
Learn Bootstrap 4
Rapid Prototyping with Sass, Compass and Middleman by Bermon Painter
Introduce Bootstrap 3 to Develop Responsive Design Application
光速テーマ開発のコツ
Introduction To WordPress
Front-End Frameworks: a quick overview
Untangling spring week8
Best Friend || Worst Enemy: WordPress Multisite
Bootstrap Framework and Drupal
Untangling spring week10
Advanced custom fields in Wordpress
Agile Wordpress
Building a Moodle theme with bootstrap
Create Custom Page Builders with Gutenberg and ACF Blocks
Elastic: Why WYSIWYG is the future of WordPress themes — WordCamp NYC 2009
Ad

Similar to Building the next generation of themes with WP Rig 2.0 (20)

PPTX
Webpack and Web Performance Optimization
PDF
Working in Harmony: Manchester - Optimize development and content workflows
KEY
Intro to html5 Boilerplate
PPTX
Best Practices for Building WordPress Applications
PDF
The WordPress Way
PDF
Working in harmony
PPTX
WP 101 - Local Development - Themes and Plugins
PDF
WP-CLI Talk from WordCamp Montreal
PDF
Wordpress beyond blogging
PPTX
WordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
PPTX
Quality code in wordpress
PDF
You Got React.js in My PHP
PPTX
NEPA BlogCon 2013 - WordPress Customization & Security
PDF
WP-CLI - WordCamp Miami 2015
PPTX
WordPress Customization and Security
PPTX
Responsive themeworkshop wcneo2016
PDF
WordPress Theme Structure
PDF
Save Time by Managing WordPress from the Command Line
PDF
Improve WordPress performance with caching and deferred execution of code
PDF
Rapid WordPress Theme Development
Webpack and Web Performance Optimization
Working in Harmony: Manchester - Optimize development and content workflows
Intro to html5 Boilerplate
Best Practices for Building WordPress Applications
The WordPress Way
Working in harmony
WP 101 - Local Development - Themes and Plugins
WP-CLI Talk from WordCamp Montreal
Wordpress beyond blogging
WordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
Quality code in wordpress
You Got React.js in My PHP
NEPA BlogCon 2013 - WordPress Customization & Security
WP-CLI - WordCamp Miami 2015
WordPress Customization and Security
Responsive themeworkshop wcneo2016
WordPress Theme Structure
Save Time by Managing WordPress from the Command Line
Improve WordPress performance with caching and deferred execution of code
Rapid WordPress Theme Development
Ad

More from Morten Rand-Hendriksen (12)

PPTX
How Not to Destroy the World: Ethics in Design and Technology
PDF
How to Not Destroy the World - the Ethics of Web Design
PDF
Gutenberg and the WordPress of Tomorrow - WordCamp US 2017
PDF
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
PDF
Empathy and Acceptance in Design and Community
PDF
Ethics and the Promise of Open Source
PDF
GitHub for the Rest of Us
PDF
Responsive Images in the Real World - presented at JavaScript Open 2015
PPTX
Can WordPress really do that? A case study of vierderduer.no
PPTX
Your Blog is Boring and Your Photos Suck
PPTX
Wp meetup custom post types
PPTX
10 WordPress Theme Hacks to Improve Your Site
How Not to Destroy the World: Ethics in Design and Technology
How to Not Destroy the World - the Ethics of Web Design
Gutenberg and the WordPress of Tomorrow - WordCamp US 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
Empathy and Acceptance in Design and Community
Ethics and the Promise of Open Source
GitHub for the Rest of Us
Responsive Images in the Real World - presented at JavaScript Open 2015
Can WordPress really do that? A case study of vierderduer.no
Your Blog is Boring and Your Photos Suck
Wp meetup custom post types
10 WordPress Theme Hacks to Improve Your Site

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PDF
KodekX | Application Modernization Development
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Understanding_Digital_Forensics_Presentation.pptx
Programs and apps: productivity, graphics, security and other tools
The Rise and Fall of 3GPP – Time for a Sabbatical?
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Network Security Unit 5.pdf for BCA BBA.
“AI and Expert System Decision Support & Business Intelligence Systems”
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
MIND Revenue Release Quarter 2 2025 Press Release
MYSQL Presentation for SQL database connectivity
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
KodekX | Application Modernization Development

Building the next generation of themes with WP Rig 2.0

  • 1. Building Progressive Themes with WP Rig Morten Rand-Hendriksen WPCampus 2019
  • 2. The web has evolved Performance Accessibility Build tools Unit testing Progressive ES2015 CSS Next
  • 3. WordPress is lagging behind PHP CSS JavaScript
  • 4. WordPress powers +34% of the web.
  • 5. WordPress powers +34% of the web. Unless WordPress stays current, it will hold 34% of the web back!
  • 6. How do we move WordPress, and through it the web forward?
  • 7. CC Gordon Joly https://goo.gl/iuRrDa
  • 12. Pave the cowpath To formalize an existing de-facto practice.
  • 14. ✓ ⨯ Things I have control over:
  • 17. • How do I Sass? • What kind of build process makes me the cool? • Can I Gulp the Grunt WebPack? • Will Composer even? • Is Yarn Homebrew, or do I need a Gem to Borwserify the Docker?
  • 19. Build process • Modern JavaScript (ES2015) • Modern CSS (custom properties, modules, etc) • WordPress Coding Standards • Code linting for PHP, JS, and CSS • Automatic internationalization • Code and asset optimization
  • 20. Starter theme • Accessible • Modern best-practices • Styled out of the box • Minimum required files • Optional templates • Progressive features including AMP support • Gutenberg, Gutenberg, Gutenberg
  • 25. The WP Rig Philosophy WP Rig does the heavy lifting so you can focus on what you do best: Build themes using modern PHP, CSS, and JavaScript.
  • 26. WP Rig is your rig Once downloaded, WP Rig becomes your rig — a unique custom theme development rig living in your development environment.
  • 27. What WP Rig does: PHP • Watches PHP files. • Checks PHP against WordPress Coding Standards. • Alerts for errors during build. • Can integrate with the code editor for in-editor alerts 
 (requires extensions). • Creates translation files for production.
  • 28. What WP Rig does: CSS • Watches CSS files. • Processes CSS through PostCSS (Autoprefixer, postcss_preset_env, etc). • Lints CSS to WordPress Coding Standards using Stylelint. • Can integrate with the code editor for in-editor alerts 
 (requires extensions). • Minifies CSS for production.
  • 29. What WP Rig does: JavaScript • Watches JavaScript files • Lints JavaScript to to WordPress Coding Standards using ESlint. • Can integrate with the code editor for in-editor alerts (requires extensions). • Processes ES2015 through Babel. • Uglifies JavaScript for production.
  • 30. Starter theme features • Accessible drop-down menu. • Modern CSS layouts (Grid, Flexbox, etc). • Modern JavaScript loading (async/defer). • Optimized Google Fonts loading. • Lazy-loading images. • AMP-ready.
  • 31. Starter theme features • Modular in-body CSS loading. • Plug-and-play template hierarchy files. • Object-Oriented PHP. • Modern CSS (custom properties etc). • Modern JavaScript (ES2015)
  • 32. 4
  • 34. https
  • 38. WP Rig helps you build modern themes. Modern themes move the web forward.
  • 40. The Workshop™©® 1. WP Rig, an introduction 2. Setup and configuration 3. Styling WP Rig themes 4. A pinch of JavaScript 5. Modern PHP in WordPress themes 6. Two deep-dive examples ✓
  • 43. Using WP Rig: 1. Set up your regular WordPress development environment. 2. Clone / copy WP Rig into the themes folder. 3. In terminal, run npm run rig-init 4. Set up config/config.json 5. In terminal, run npm run dev 6. Start developing
  • 48. https
  • 51. ✓ ✓ ✓ 😴
  • 53. Using WP Rig: 1. Set up your regular WordPress development environment. 2. Clone / copy WP Rig into the themes folder. 3. In terminal, run npm run rig-init 4. Set up config/config.json 5. In terminal, run npm run dev 6. Start developing ✓ ✓ ✓ ✓ 👉
  • 54. npm run dev npm run build npm run bundle
  • 55. The Workshop™©® 1. WP Rig, an introduction 2. Setup and configuration 3. Styling WP Rig themes 4. A pinch of JavaScript 5. Modern PHP in WordPress themes 6. Two deep-dive examples ✓ ✓ 👉
  • 56. The WP Rig Philosophy WP Rig does the heavy lifting so you can focus on what you do best: Build themes using modern PHP, CSS, and JavaScript.
  • 57. What WP Rig does: CSS • Watches CSS files. • Processes CSS through PostCSS (Autoprefixer, postcss_preset_env, etc). • Lints CSS to WordPress Coding Standards using Stylelint. • Can integrate with the code editor for in-editor alerts 
 (requires extensions). • Minifies CSS for production.
  • 60. Primary stylesheet - always loaded
  • 64. Layouts with flex and grid
  • 67. CSS Custom Properties (variables)
  • 73. The WP Rig Philosophy WP Rig does the heavy lifting so you can focus on what you do best: Build themes using modern PHP, CSS, and JavaScript.
  • 74. CSS in WP Rig Component-level stylesheets, loaded progressively inside the <body> element via template files.
  • 79. The Workshop™©® 1. WP Rig, an introduction 2. Setup and configuration 3. Styling WP Rig themes 4. A pinch of JavaScript 5. Modern PHP in WordPress themes 6. Two deep-dive examples ✓ ✓ ✓ 👉
  • 81. Script download Script execution <script> <script async> <script defer> HTML parse Parse paused
  • 86. The WP Rig Philosophy WP Rig does the heavy lifting so you can focus on what you do best: Build themes using modern PHP, CSS, and JavaScript.
  • 87. The Workshop™©® 1. WP Rig, an introduction 2. Setup and configuration 3. Styling WP Rig themes 4. A pinch of JavaScript 5. Modern PHP in WordPress themes 6. Two deep-dive examples ✓ ✓ ✓ 👉 ✓
  • 90. PHP in WP Rig • Templates work as they always have. • Core template functions work as they always have. • index.php is the base template for every view. • Template parts live in ./template-parts/ • ./optional/ folder has optional drag-and-drop template files. • Custom functions are called using
 wp_rig()->function_name();
  • 91. The Workshop™©® 1. WP Rig, an introduction 2. Setup and configuration 3. Styling WP Rig themes 4. A pinch of JavaScript 5. Modern PHP in WordPress themes 6. Two deep-dive examples ✓ ✓ ✓ 👉 ✓ ✓
  • 92. The Workshop™©® 1. WP Rig, an introduction 2. Setup and configuration 3. Styling WP Rig themes 4. Modern PHP in WordPress themes 5. A pinch of JavaScript 6. Two deep-dive examples ✓ ✓ ✓ ✓ ✓ ✓
  • 95. github.com/wprig/wprig Contribute to WP Rig and make it yours: