SlideShare ist ein Scribd-Unternehmen logo
1 von 96
Downloaden Sie, um offline zu lesen
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!

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (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
 

Ähnlich wie Building the next generation of themes with WP Rig 2.0

WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp Montreal
Shawn Hooper
 
WordPress Customization and Security
WordPress Customization and SecurityWordPress Customization and Security
WordPress Customization and Security
Joe Casabona
 

Ähnlich wie 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
 

Mehr von Morten Rand-Hendriksen

Mehr von 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
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

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: