SlideShare a Scribd company logo
1 of 96
Download to read offline
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
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:
• 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
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
https
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
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 rig-init
npm install
./config/config.json
https
npm run generateCert
✓ ✓ ✓ 😴
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
Primary stylesheet - always loaded
Theme stylesheets
Partials called using @import
Layouts with flex and grid
CSS Custom Properties (variables)
Google Fonts
preconnect
preload
optimized
✓
✓
✓
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.
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
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
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

What's hot

Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013Jonny Allbut
 
Responsive Web Design Tutorial PDF for Beginners
Responsive Web Design Tutorial PDF for BeginnersResponsive Web Design Tutorial PDF for Beginners
Responsive Web Design Tutorial PDF for BeginnersBootstrap Creative
 
Word press development for non developers
Word press development for non developers Word press development for non developers
Word press development for non developers Jessica C. Gardner
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1Derek Jacoby
 
10 Cool Things You Can Do with Widgets
10 Cool Things You Can Do with Widgets10 Cool Things You Can Do with Widgets
10 Cool Things You Can Do with Widgetsdrywallbmb
 
Rapid Prototyping with Sass, Compass and Middleman by Bermon Painter
Rapid Prototyping with Sass, Compass and Middleman by Bermon PainterRapid Prototyping with Sass, Compass and Middleman by Bermon Painter
Rapid Prototyping with Sass, Compass and Middleman by Bermon PainterCodemotion
 
Introduce Bootstrap 3 to Develop Responsive Design Application
Introduce Bootstrap 3 to Develop Responsive Design ApplicationIntroduce Bootstrap 3 to Develop Responsive Design Application
Introduce Bootstrap 3 to Develop Responsive Design ApplicationeXo Platform
 
光速テーマ開発のコツ
光速テーマ開発のコツ光速テーマ開発のコツ
光速テーマ開発のコツHishikawa Takuro
 
Introduction To WordPress
Introduction To WordPressIntroduction To WordPress
Introduction To WordPressCraig Bailey
 
Front-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewFront-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewDiacode
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8Derek Jacoby
 
Best Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteBest Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteTaylor McCaslin
 
Bootstrap Framework and Drupal
Bootstrap Framework and DrupalBootstrap Framework and Drupal
Bootstrap Framework and DrupalJim Birch
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10Derek Jacoby
 
Advanced custom fields in Wordpress
Advanced custom fields in WordpressAdvanced custom fields in Wordpress
Advanced custom fields in WordpressExove
 
Building a Moodle theme with bootstrap
Building a Moodle theme with bootstrapBuilding a Moodle theme with bootstrap
Building a Moodle theme with bootstrapBas Brands
 
Create Custom Page Builders with Gutenberg and ACF Blocks
Create Custom Page Builders with Gutenberg and ACF BlocksCreate Custom Page Builders with Gutenberg and ACF Blocks
Create Custom Page Builders with Gutenberg and ACF BlocksCory Webb
 
Elastic: Why WYSIWYG is the future of WordPress themes — WordCamp NYC 2009
Elastic: Why WYSIWYG is the future of WordPress themes — WordCamp NYC 2009Elastic: Why WYSIWYG is the future of WordPress themes — WordCamp NYC 2009
Elastic: Why WYSIWYG is the future of WordPress themes — WordCamp NYC 2009Daryl Koopersmith
 

What's hot (20)

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

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

Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance OptimizationChen-Tien Tsai
 
Working in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflowsWorking in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflowsEdmund Turbin
 
Intro to html5 Boilerplate
Intro to html5 BoilerplateIntro to html5 Boilerplate
Intro to html5 BoilerplateMichael Enslow
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsTaylor Lovett
 
WP 101 - Local Development - Themes and Plugins
WP 101 - Local Development - Themes and PluginsWP 101 - Local Development - Themes and Plugins
WP 101 - Local Development - Themes and PluginsJoe Querin
 
WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealShawn Hooper
 
Wordpress beyond blogging
Wordpress beyond bloggingWordpress beyond blogging
Wordpress beyond bloggingJulien Minguely
 
WordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
WordCamp Kent 2019 - WP 101: Local Development - Themes and PluginsWordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
WordCamp Kent 2019 - WP 101: Local Development - Themes and PluginsJoe Querin
 
Quality code in wordpress
Quality code in wordpressQuality code in wordpress
Quality code in wordpressRan Bar-Zik
 
You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHPTaylor Lovett
 
NEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityNEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityMichelle Davies (Hryvnak)
 
WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015Shawn Hooper
 
WordPress Customization and Security
WordPress Customization and SecurityWordPress Customization and Security
WordPress Customization and SecurityJoe Casabona
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016David Brattoli
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structurekeithdevon
 
Save Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command LineSave Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command LineShawn Hooper
 
Improve WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of codeImprove WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of codeDanilo Ercoli
 
Rapid WordPress Theme Development
Rapid WordPress Theme DevelopmentRapid WordPress Theme Development
Rapid WordPress Theme DevelopmentJosh Williams
 

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

Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
Working in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflowsWorking in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflows
 
Intro to html5 Boilerplate
Intro to html5 BoilerplateIntro to html5 Boilerplate
Intro to html5 Boilerplate
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
The WordPress Way
The WordPress WayThe WordPress Way
The WordPress Way
 
Working in harmony
Working in harmonyWorking in harmony
Working in harmony
 
WP 101 - Local Development - Themes and Plugins
WP 101 - Local Development - Themes and PluginsWP 101 - Local Development - Themes and Plugins
WP 101 - Local Development - Themes and Plugins
 
WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp Montreal
 
Wordpress beyond blogging
Wordpress beyond bloggingWordpress beyond blogging
Wordpress beyond blogging
 
WordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
WordCamp Kent 2019 - WP 101: Local Development - Themes and PluginsWordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
WordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
 
Quality code in wordpress
Quality code in wordpressQuality code in wordpress
Quality code in wordpress
 
You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHP
 
NEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityNEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & Security
 
WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015
 
WordPress Customization and Security
WordPress Customization and SecurityWordPress Customization and Security
WordPress Customization and Security
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
 
Save Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command LineSave Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command Line
 
Improve WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of codeImprove WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of code
 
Rapid WordPress Theme Development
Rapid WordPress Theme DevelopmentRapid WordPress Theme Development
Rapid WordPress Theme Development
 

More from Morten Rand-Hendriksen

How Not to Destroy the World: Ethics in Design and Technology
How Not to Destroy the World: Ethics in Design and TechnologyHow Not to Destroy the World: Ethics in Design and Technology
How Not to Destroy the World: Ethics in Design and TechnologyMorten Rand-Hendriksen
 
How to Not Destroy the World - the Ethics of Web Design
How to Not Destroy the World - the Ethics of Web DesignHow to Not Destroy the World - the Ethics of Web Design
How to Not Destroy the World - the Ethics of Web DesignMorten Rand-Hendriksen
 
Gutenberg and the WordPress of Tomorrow - WordCamp US 2017
Gutenberg and the WordPress of Tomorrow - WordCamp US 2017Gutenberg and the WordPress of Tomorrow - WordCamp US 2017
Gutenberg and the WordPress of Tomorrow - WordCamp US 2017Morten Rand-Hendriksen
 
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017Morten Rand-Hendriksen
 
Empathy and Acceptance in Design and Community
Empathy and Acceptance in Design and CommunityEmpathy and Acceptance in Design and Community
Empathy and Acceptance in Design and CommunityMorten Rand-Hendriksen
 
Responsive Images in the Real World - presented at JavaScript Open 2015
Responsive Images in the Real World - presented at JavaScript Open 2015Responsive Images in the Real World - presented at JavaScript Open 2015
Responsive Images in the Real World - presented at JavaScript Open 2015Morten Rand-Hendriksen
 
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.noCan WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.noMorten Rand-Hendriksen
 
Your Blog is Boring and Your Photos Suck
Your Blog is Boring and Your Photos SuckYour Blog is Boring and Your Photos Suck
Your Blog is Boring and Your Photos SuckMorten Rand-Hendriksen
 
10 WordPress Theme Hacks to Improve Your Site
10 WordPress Theme Hacks to Improve Your Site10 WordPress Theme Hacks to Improve Your Site
10 WordPress Theme Hacks to Improve Your SiteMorten Rand-Hendriksen
 

More from Morten Rand-Hendriksen (12)

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

Recently uploaded

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

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
  • 9.
  • 10.
  • 11.
  • 12. Pave the cowpath To formalize an existing de-facto practice.
  • 14. ✓ ⨯ Things I have control over:
  • 15.
  • 16.
  • 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
  • 21.
  • 22.
  • 23.
  • 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
  • 33.
  • 34. https
  • 35.
  • 36.
  • 37.
  • 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 ✓
  • 42.
  • 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
  • 44.
  • 45.
  • 48. https
  • 50.
  • 51. ✓ ✓ ✓ 😴
  • 52.
  • 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.
  • 59.
  • 60. Primary stylesheet - always loaded
  • 63.
  • 64. Layouts with flex and grid
  • 65.
  • 66.
  • 67. CSS Custom Properties (variables)
  • 68.
  • 69.
  • 70.
  • 72.
  • 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.
  • 75.
  • 76.
  • 77.
  • 78.
  • 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
  • 82.
  • 83.
  • 84.
  • 85.
  • 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 ✓ ✓ ✓ 👉 ✓
  • 89.
  • 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: