SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.soniya singh
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
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
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.CarlotaBedoya1
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 

Dernier (20)

On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
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
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 

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