SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Wordpress, Beyond Blogging
Use it as a framework
Julien Minguely
Web Developer @ Antistatique
jminguely
• eikon’s Alumni
• Jazz Student
• Wordpress Lover
Summary
• Use Case presentation
• Is Wordpress a Framework ?
• A good development workflow
• Latest features & the future of Wordpress
• Conclusion
Disclaimer
• I’ll feed you a lot of
information really fast
• Focus on the concepts
• Comeback later to analyse
the examples & copy/paste
the codes
Wordpress is not just for Bloggin
• Made for everyone
• Has many uses
• Modular set of tools
• The community is huge
A Use Case
Also known as « Your next agency portfolio »
Basic page Blog
Single
Articles
Competence
Project
Team
Is WP a Framework?
Is WP a Framework?
URL Rewriting
• Map human-readable
URL’s to content &
page in Wordpress
• Works with Page,
Taxonomy, Single
Post, Archive
https://codex.wordpress.org/Rewrite_API/add_rewrite_rule
https://codex.wordpress.org/Function_Reference/get_query_var
https://wordpress.org/plugins/rewrite-rules-inspector/
http://your-agency.com/contact
http://your-agency.com/team
http://your-agency.com/team/julien-minguely
Is WP a Framework?
Database interface
• Powerful database interface (WP_Query)
• Talk to the DB through abstraction
• Makes DB call more simple & secure
• Direct access to the DB via wpdb() 

(Beware the nefarious SQL injection)
https://codex.wordpress.org/Class_Reference/WP_Query
https://codex.wordpress.org/Class_Reference/wpdb
⚠
Is WP a Framework?
Templating
• Filename based
• Target many parameters 

(Post Type, Slug, ID, Template)
https://developer.wordpress.org/themes/basics/template-hierarchy/
Page
page-$slug.php
page-$id.php
page.php
index.php
Is WP a Framework?
User & security
• Login & Security routine
• Role & capabilities based
• Can be extended with custom
roles / caps
• Use it to restrict & allow your
client
! "
Admin Client
Is WP a Framework?
Administration panel
• Clean & accessible UI
• Wysiwyg editor
• Easy to use 

(even for your client)
functions.php
Is WP a Framework?
Plugin API
• Hooks (Actions & Filter)
• Apply to the front/back-end
• Keeps everything external
to the core
https://codex.wordpress.org/Plugin_API
function notify_mail($post_ID) {
mail('bob@example.org',
'Blog updated',
'New blog on your-agency.com’);
return $post_ID;
}
add_action('publish_post', 'notify_mail');
Is WP a Framework?
Media management
• Media storage
• Supports photo/audio/video
• Upload by drag & drop
• Images size generation
Is WP a Framework?
What’s missing
What’s missing
Cache
• No caching solution are available out of the box
• Plugins (free & premium)
• Transients API
https://codex.wordpress.org/Transients_API
if ( false === ( $facebook_feed = get_transient( ‘facebook_feed’ ))) {  
// It wasn't there, so regenerate the data and save the transient
$facebook_feed = your_incredible_facebook_crawler_method();
set_transient( facebook_feed, $facebook_feed, 12 * HOUR_IN_SECONDS );
}
What’s missing
I18n
(also known as internationalization)
• The backend is translated
• Wordpress list you all the solutions: 

https://codex.wordpress.org/Multilingual_WordPress
• We use WPML (content & theme text translation)
https://codex.wordpress.org/I18n_for_WordPress_Developers
How to write a WP
theme like a boss
Let’s write a theme
Folder structure
• Based on bedrock
• Separate configs per environment
• Environment variables
https://roots.io/bedrock/
"## composer.json
"## .env
"## config
$ "## application.php
$ %## environments
$ "## development.php
$ "## staging.php
$ %## production.php
"## vendor
%## web
"## app
$ "## mu-plugins
$ "## plugins
$ "## themes
$ %## uploads
"## wp-config.php
"## index.php
%## wp
Let’s write a theme
Git for Code versionning
• Git track your code & help you collaborate with
other developer
• Track only the codebase

(and not the external vendors)
• We use GitHub & Git Flow
https://try.github.io
Let’s write a theme
Dependency manager
• Composer
• WP core & plugins
• $ composer install
• WPackagist for 

WP plugin & theme
composer.json
...
require: {
  "php": ">=5.6",
  "composer/installers": "~1.0.12",
  "vlucas/phpdotenv": "^2.0.1",
  "oscarotero/env": "^1.0",
  "roots/wp-password-bcrypt": "1.0.0",
  "johnpbloch/wordpress": "^4.7",
  "wpackagist-plugin/timber-library": "^1.2",
  "wpackagist-plugin/simple-custom-post-order": "^2.3.2"
},
...
https://getcomposer.org/
https://wpackagist.org/
Let’s write a theme
The Post is the mother of all
• Everything in Wordpress is a Post
• Register custom post with
register_post_type()
• In our use case: 

Team, Competence & Projects are CPT
https://codex.wordpress.org/Function_Reference/register_post_type
https://generatewp.com/post-type/
single-project.twig
Let’s write a theme
Twig
• Timber offers us the
Twig Template Engine
• Keeps the logical 

part (PHP) separate 

from the markup (HTML)
https://timber.github.io/docs/
<?php
use TimberTimber;
use LumberjackPostTypesProject;
$context = Timber::get_context();
$context['foo'] = 'Bar!';
$context[‘project’] = new Timber/Project();
Timber::render('single-project.twig', $context);
{% extends "base.twig" %}
{% block content %}
  <h1 class="big-title">{{foo}}</h1>
  <h2>{{project.title}}</h2>
  <img src="{{project.thumbnail.src}}" />
  <div class="body"> {{project.content}} </div>
{% endblock %}
single-project.php
Let’s write a theme
Fields
• Contains various information
relative to our post (or
page or custom posts)
• Stored as meta-data
https://codex.wordpress.org/Metadata_API
Member
• Nom
• Prénom
• Biographie
• Photo de couverture
• Date de naissance
• Adresse
• Couleur (HEX)
• Facebook / Instagram post
Project
• Date de réalisation
• Galerie
• Description
• Youtube embed video
• Team member collaborator
Let’s write a theme
Advanced Custom Fields (ACF)
• Helps us define the custom fields
• Powerful and easy-to-edit backend
• Edit the fields directly in the
backend of Wordpress
• Export your conf as a .json
https://www.advancedcustomfields.com/resources/
https://timber.github.io/docs/guides/acf-cookbook/
{% for image in project.galerie %}
<figure>
<img
src="{{ image.src }}"
alt="{{ image.alt }}" />
<figcaption>
{{ image.caption }}
</figcaption>
</figure>
{% endfor %}
Let’s write a theme
Continuous deployment
• Dev, Staging & Production
• Drag n drop files through 

FTP IS NOT deployment
• Capistrano contains recipe 

to maintain these environment
http://capistranorb.com
https://github.com/roots/bedrock-capistrano
https://github.com/morrislaptop/wordpress-capistrano
$ bundle exec cap -T
$ bundle exec cap staging deploy
$ bundle exec cap production deploy
$ bundle exec cap production 

wordpress:db:push
$ bundle exec cap production 

wordpress:uploads:pull
What’s new & 

what’s to come
Rest API
• Since WP 4.4
• Access to WP through a
service
• Return a JSON
http://your-agency.com/wp-json/wp/v2/pages/
[{
"id": 3,
"date": "2017-11-12T23:48:48",
"date_gmt": "2017-11-12T22:48:48",
"guid": {
"rendered": ‘http://your-agency.com?page_id=3'
},
"modified": "2017-11-13T11:44:27",
"modified_gmt": "2017-11-13T10:44:27",
"slug": "homepage",
"status": "publish",
"type": "page",
"link": "http://your-agency.com",
"title": {
"rendered": "Homepage"
},
…
Gutenberg
• For WP 5.0
• Block layout
• Revamps the editor
• Written in React
• In Beta
https://github.com/WordPress/gutenberg
Moar features
4.2: Emoji
4.4: Responsive images (sources + srcset)
4.4: oEmbed
4.7: Thumbnail Previews for PDF Files
4.7: Custom Bulk Actions
0
What you should do now?
• Check out our starter theme 

(https://github.com/antistatique/antistapress)
• Keep yourself informed about WP
• Attend a WordCamp once in your life

(https://central.wordcamp.org/schedule/)
• Learn to use Git, Composer, Yarn & Capistrano
Thanks 12
jminguely
Questions ?
• In a way, Wordpress is more than a
framework
• It’s a set of tools
• You gonna save time to focus on the
frontend
• Your client will be happy to edit
his website
Slideshare: bit.ly/meetup-wp-blogging
ExclusivE
ORIGINAL
QuestionsAnswers

Más contenido relacionado

La actualidad más candente

Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Joe Querin
 
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
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012Joe Querin
 
Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPressJeff Cohan
 
Essential plugins for your WordPress Website
Essential plugins for your WordPress WebsiteEssential plugins for your WordPress Website
Essential plugins for your WordPress WebsiteAnthony Hortin
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalChandra Prakash Thapa
 
WordPress as a Service
WordPress as a ServiceWordPress as a Service
WordPress as a ServiceAndrew Bauer
 
Anatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress ThemeAnatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress ThemeJulie Kuehl
 
The WordPress University
The WordPress UniversityThe WordPress University
The WordPress UniversityStephanie Leary
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsAmanda Giles
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themesrfair404
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1Yoav Farhi
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016David Brattoli
 
Learn How to Use Atomic Design to Make Your Site Manageable and Adaptable
Learn How to Use Atomic Design to Make Your Site Manageable and AdaptableLearn How to Use Atomic Design to Make Your Site Manageable and Adaptable
Learn How to Use Atomic Design to Make Your Site Manageable and AdaptableAcquia
 
Extension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaExtension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaTim Plummer
 
Zurb foundation
Zurb foundationZurb foundation
Zurb foundationsean_todd
 
jQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchAppsjQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchAppsBradley Holt
 

La actualidad más candente (20)

Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015
 
What is (not) WordPress
What is (not) WordPressWhat is (not) WordPress
What is (not) WordPress
 
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
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 
Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPress
 
Essential plugins for your WordPress Website
Essential plugins for your WordPress WebsiteEssential plugins for your WordPress Website
Essential plugins for your WordPress Website
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
WordPress as a Service
WordPress as a ServiceWordPress as a Service
WordPress as a Service
 
Anatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress ThemeAnatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress Theme
 
The WordPress University
The WordPress UniversityThe WordPress University
The WordPress University
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable Needs
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016
 
Learn How to Use Atomic Design to Make Your Site Manageable and Adaptable
Learn How to Use Atomic Design to Make Your Site Manageable and AdaptableLearn How to Use Atomic Design to Make Your Site Manageable and Adaptable
Learn How to Use Atomic Design to Make Your Site Manageable and Adaptable
 
Extension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaExtension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with Joomla
 
Zurb foundation
Zurb foundationZurb foundation
Zurb foundation
 
jQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchAppsjQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchApps
 

Similar a Wordpress beyond blogging

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)
 
WordPress Customization and Security
WordPress Customization and SecurityWordPress Customization and Security
WordPress Customization and SecurityJoe Casabona
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With LoveUp2 Technology
 
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
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsTaylor Lovett
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...Denise Williams
 
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slidesKeep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slidesJer Clarke
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme developmentJonny Allbut
 
WordPress
WordPressWordPress
WordPressrisager
 
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0Morten Rand-Hendriksen
 
Starting WordPress Theme Review
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme ReviewCatch Themes
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...rtCamp
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPrandyhoyt
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentEvan Mullins
 
Get Involved with WordPress
Get Involved with WordPressGet Involved with WordPress
Get Involved with WordPressMario Peshev
 
Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Think Media Inc.
 
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
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 

Similar a Wordpress beyond blogging (20)

NEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityNEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & Security
 
The WordPress Way
The WordPress WayThe WordPress Way
The WordPress Way
 
WordPress Customization and Security
WordPress Customization and SecurityWordPress Customization and Security
WordPress Customization and Security
 
WordPress Complete Tutorial
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete Tutorial
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With Love
 
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
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...
 
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slidesKeep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme development
 
WordPress
WordPressWordPress
WordPress
 
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
 
Starting WordPress Theme Review
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme Review
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHP
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
 
Get Involved with WordPress
Get Involved with WordPressGet Involved with WordPress
Get Involved with WordPress
 
Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013
 
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
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 

Último

Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftAanSulistiyo
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...roncy bisnoi
 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...tanu pandey
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...SUHANI PANDEY
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 

Último (20)

Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 

Wordpress beyond blogging

  • 1. Wordpress, Beyond Blogging Use it as a framework
  • 2. Julien Minguely Web Developer @ Antistatique jminguely • eikon’s Alumni • Jazz Student • Wordpress Lover
  • 3. Summary • Use Case presentation • Is Wordpress a Framework ? • A good development workflow • Latest features & the future of Wordpress • Conclusion
  • 4. Disclaimer • I’ll feed you a lot of information really fast • Focus on the concepts • Comeback later to analyse the examples & copy/paste the codes
  • 5. Wordpress is not just for Bloggin • Made for everyone • Has many uses • Modular set of tools • The community is huge
  • 6. A Use Case Also known as « Your next agency portfolio » Basic page Blog Single Articles Competence Project Team
  • 7. Is WP a Framework?
  • 8. Is WP a Framework? URL Rewriting • Map human-readable URL’s to content & page in Wordpress • Works with Page, Taxonomy, Single Post, Archive https://codex.wordpress.org/Rewrite_API/add_rewrite_rule https://codex.wordpress.org/Function_Reference/get_query_var https://wordpress.org/plugins/rewrite-rules-inspector/ http://your-agency.com/contact http://your-agency.com/team http://your-agency.com/team/julien-minguely
  • 9. Is WP a Framework? Database interface • Powerful database interface (WP_Query) • Talk to the DB through abstraction • Makes DB call more simple & secure • Direct access to the DB via wpdb() 
 (Beware the nefarious SQL injection) https://codex.wordpress.org/Class_Reference/WP_Query https://codex.wordpress.org/Class_Reference/wpdb ⚠
  • 10. Is WP a Framework? Templating • Filename based • Target many parameters 
 (Post Type, Slug, ID, Template) https://developer.wordpress.org/themes/basics/template-hierarchy/ Page page-$slug.php page-$id.php page.php index.php
  • 11. Is WP a Framework? User & security • Login & Security routine • Role & capabilities based • Can be extended with custom roles / caps • Use it to restrict & allow your client ! " Admin Client
  • 12. Is WP a Framework? Administration panel • Clean & accessible UI • Wysiwyg editor • Easy to use 
 (even for your client)
  • 13. functions.php Is WP a Framework? Plugin API • Hooks (Actions & Filter) • Apply to the front/back-end • Keeps everything external to the core https://codex.wordpress.org/Plugin_API function notify_mail($post_ID) { mail('bob@example.org', 'Blog updated', 'New blog on your-agency.com’); return $post_ID; } add_action('publish_post', 'notify_mail');
  • 14. Is WP a Framework? Media management • Media storage • Supports photo/audio/video • Upload by drag & drop • Images size generation
  • 15. Is WP a Framework? What’s missing
  • 16. What’s missing Cache • No caching solution are available out of the box • Plugins (free & premium) • Transients API https://codex.wordpress.org/Transients_API if ( false === ( $facebook_feed = get_transient( ‘facebook_feed’ ))) {   // It wasn't there, so regenerate the data and save the transient $facebook_feed = your_incredible_facebook_crawler_method(); set_transient( facebook_feed, $facebook_feed, 12 * HOUR_IN_SECONDS ); }
  • 17. What’s missing I18n (also known as internationalization) • The backend is translated • Wordpress list you all the solutions: 
 https://codex.wordpress.org/Multilingual_WordPress • We use WPML (content & theme text translation) https://codex.wordpress.org/I18n_for_WordPress_Developers
  • 18. How to write a WP theme like a boss
  • 19. Let’s write a theme Folder structure • Based on bedrock • Separate configs per environment • Environment variables https://roots.io/bedrock/ "## composer.json "## .env "## config $ "## application.php $ %## environments $ "## development.php $ "## staging.php $ %## production.php "## vendor %## web "## app $ "## mu-plugins $ "## plugins $ "## themes $ %## uploads "## wp-config.php "## index.php %## wp
  • 20. Let’s write a theme Git for Code versionning • Git track your code & help you collaborate with other developer • Track only the codebase
 (and not the external vendors) • We use GitHub & Git Flow https://try.github.io
  • 21. Let’s write a theme Dependency manager • Composer • WP core & plugins • $ composer install • WPackagist for 
 WP plugin & theme composer.json ... require: {   "php": ">=5.6",   "composer/installers": "~1.0.12",   "vlucas/phpdotenv": "^2.0.1",   "oscarotero/env": "^1.0",   "roots/wp-password-bcrypt": "1.0.0",   "johnpbloch/wordpress": "^4.7",   "wpackagist-plugin/timber-library": "^1.2",   "wpackagist-plugin/simple-custom-post-order": "^2.3.2" }, ... https://getcomposer.org/ https://wpackagist.org/
  • 22. Let’s write a theme The Post is the mother of all • Everything in Wordpress is a Post • Register custom post with register_post_type() • In our use case: 
 Team, Competence & Projects are CPT https://codex.wordpress.org/Function_Reference/register_post_type https://generatewp.com/post-type/
  • 23. single-project.twig Let’s write a theme Twig • Timber offers us the Twig Template Engine • Keeps the logical 
 part (PHP) separate 
 from the markup (HTML) https://timber.github.io/docs/ <?php use TimberTimber; use LumberjackPostTypesProject; $context = Timber::get_context(); $context['foo'] = 'Bar!'; $context[‘project’] = new Timber/Project(); Timber::render('single-project.twig', $context); {% extends "base.twig" %} {% block content %}   <h1 class="big-title">{{foo}}</h1>   <h2>{{project.title}}</h2>   <img src="{{project.thumbnail.src}}" />   <div class="body"> {{project.content}} </div> {% endblock %} single-project.php
  • 24. Let’s write a theme Fields • Contains various information relative to our post (or page or custom posts) • Stored as meta-data https://codex.wordpress.org/Metadata_API Member • Nom • Prénom • Biographie • Photo de couverture • Date de naissance • Adresse • Couleur (HEX) • Facebook / Instagram post Project • Date de réalisation • Galerie • Description • Youtube embed video • Team member collaborator
  • 25. Let’s write a theme Advanced Custom Fields (ACF) • Helps us define the custom fields • Powerful and easy-to-edit backend • Edit the fields directly in the backend of Wordpress • Export your conf as a .json https://www.advancedcustomfields.com/resources/ https://timber.github.io/docs/guides/acf-cookbook/ {% for image in project.galerie %} <figure> <img src="{{ image.src }}" alt="{{ image.alt }}" /> <figcaption> {{ image.caption }} </figcaption> </figure> {% endfor %}
  • 26. Let’s write a theme Continuous deployment • Dev, Staging & Production • Drag n drop files through 
 FTP IS NOT deployment • Capistrano contains recipe 
 to maintain these environment http://capistranorb.com https://github.com/roots/bedrock-capistrano https://github.com/morrislaptop/wordpress-capistrano $ bundle exec cap -T $ bundle exec cap staging deploy $ bundle exec cap production deploy $ bundle exec cap production 
 wordpress:db:push $ bundle exec cap production 
 wordpress:uploads:pull
  • 27. What’s new & 
 what’s to come
  • 28. Rest API • Since WP 4.4 • Access to WP through a service • Return a JSON http://your-agency.com/wp-json/wp/v2/pages/ [{ "id": 3, "date": "2017-11-12T23:48:48", "date_gmt": "2017-11-12T22:48:48", "guid": { "rendered": ‘http://your-agency.com?page_id=3' }, "modified": "2017-11-13T11:44:27", "modified_gmt": "2017-11-13T10:44:27", "slug": "homepage", "status": "publish", "type": "page", "link": "http://your-agency.com", "title": { "rendered": "Homepage" }, …
  • 29. Gutenberg • For WP 5.0 • Block layout • Revamps the editor • Written in React • In Beta https://github.com/WordPress/gutenberg
  • 30. Moar features 4.2: Emoji 4.4: Responsive images (sources + srcset) 4.4: oEmbed 4.7: Thumbnail Previews for PDF Files 4.7: Custom Bulk Actions 0
  • 31. What you should do now? • Check out our starter theme 
 (https://github.com/antistatique/antistapress) • Keep yourself informed about WP • Attend a WordCamp once in your life
 (https://central.wordcamp.org/schedule/) • Learn to use Git, Composer, Yarn & Capistrano
  • 33. Questions ? • In a way, Wordpress is more than a framework • It’s a set of tools • You gonna save time to focus on the frontend • Your client will be happy to edit his website Slideshare: bit.ly/meetup-wp-blogging ExclusivE ORIGINAL QuestionsAnswers