SlideShare a Scribd company logo
Beyond the Theme Using WordPress as an API
About Me Find me on online at: @davidscottufts facebook.com/davidscottufts linkedin.com/in/davidtufts davidscotttufts.com I’m not a WordPress guru, ninja, black-belt, author, blogger, consultant, or hacker I do use WordPress everywhere
One Year of WordPress at Work Migrated 14 unique brand sites and over 40 unique domains in 7 languages to WordPress multi-site Our most popular brand’s average page views increased from 85,000 to 150,000 (over 130,000 daily emails, over 45,000 iPhone/iPad apps, and over 65,000 Facebook fans) Our online donations increased by 38% Reduced server footprint by 40% and our overhead costs decreased by 30% Development time, costs, and learning curve for new developers were also all significantly reduced
Goals of a WordPress Based Web Strategy Have one install for multiple sites Allow for a single sign-on across a network of sites Use an API to allow for content to be easily accessible by other websites and mobile devices Integrate web, social, mobile, social bookmarking, and monetization strategies Aggregate and curate content from across the network of sites in one central stream Think globally—location and language matter
Why WordPress It met the conditions of our web strategy It has multi-site capabilities It is open source (FREE) It is easy to migrate to It is easy to use It is easy to install and upgrade It is popular (15% of the web runs on WordPress) It is versatile
Versatile you say? Extend it with themes and plugins Modify it with hooks Create custom post types Add custom fields Use custom taxonomies Specify post formats
An Analogy—Part 1 The WordPress admin area is like a kitchen and you are the chef The WordPress plugins are like the kitchen appliances that make for a better cooking experience The WordPress theme is like the dining room where the content is laid out for consumption There is a one-to-one relationship between your content and its container, the theme
Content vs. Container A WordPress theme exists only within the context of its container—the web browser Your content is consumed from within your website’s theme Your RSS feed is the only way in which your content can be consumed from outside your website’s theme
How Do People Find Your Site Search engines index your content Searches point people to your site Users subscribe to your RSS feed Friends might link to your site Anyone can share your content on social networks
Your Websites Current Sphere of Influence
Introduction to APIs 	“An API (Application Programming Interface) is a way for two applications to talk to each other in a common language that both systems understand. An API essentially provides a structured way for applications to get content in a predictable, flexible, and powerful way.”
Does WordPress have an API? WordPress has XML-RPC for data management at the admin level WordPress has multiple built-in APIs that allow developers to enhance WordPress through plugins and themes WordPress has a robust query string that enables content filtering through the URL WordPress has no end user API that allows for third-party development around your content
What Can an API do for You? Allows you to have a single instance of your content and users distributed across multiple channels Allows developers to build third-party applications around your web-based content or service Allows you to enhance the user experience within the context of your site by building an AJAX rich application
Separating Content from Container WordPress separates the admin and plugins from the theme It allows for the content to          exist independently of the      website’s theme Modifying a site’s theme        does not impact your content
An Analogy—Part 2 Same kitchen, chef, appliances, and dining room as the earlier analogy An API turns your kitchen into a catering business with delivery trucks There is a one-to-many relationship between your content and multiple containers: mobile apps, third-party websites, and social networks
Adding an API to WordPress Expands Your Sphere of Influence
3 Simple Steps to Implementing an API into Your Next WordPress Theme Pass additional query string parameters to the theme Modify the theme to process API calls Determine what format to return the  content in
Step 1: Pass Additional Query String Parameters to the Theme Define a query string parameter to specify whether or not the request being made is an API call.  Always default the parameter to false in the theme as to not disrupt non API requests (?api=true) Define a query string parameter to specify in what format to return the content (&format=json)
Step 2: Modify the Theme to Process API Calls <?php     $api = $_GET[‘api’];     $f = $_GET[‘format’]; Section off the header and footer with conditional statements within files like index.php, single.php, archive.php, category.php, tag.php, and search.php Evaluate based on the query string parameters if an API call needs the header and footer If ( $api ) {    // Conditional Header } // The Loop get_template_part(‘loop’,  $f); If ( $api ) {     // Conditional Footer } ?>
Step 3: Determine What Format to Return the Content In Create a series of loops in different formats to handle your custom API requests: loop-html5.php, loop-json.php, loop-xml.php Allow the get_template_part() function to determine the appropriate format to use:get_template_part(‘loop’, $_GET[‘format’]);
Example You have built an events management WordPress theme using custom post types for events, sessions, speakers, attendees, and venues. Now your conference attendees want to use their smart phones or tablets during an event to manage their schedules, rate sessions, etc.
Allowing for Third-Party Development Every new “app” is just another instance of a group of your users interacting with your content or service Twitter would not be were it is today without an API which allows users and developers to interact with Twitter’s services on their terms
Post Rank vs. Page Rank The tide is changing from searchability to shareability SEO is still be important, but what is more important is how accessible and shareable your content is from multiple devices, apps, and social networks
Other API Implementation Ideas Use the API calls for AJAX reloading from within the context of the WordPress theme Use in conjunction with other query string parameters to determine the post type, posts per page, sort order, etc. Be sure to output the correct headers to the browser in the cases where the requested formats are like JSON, XML, or downloadable files
Write It Yourself or Use KickPress The KickPressplugingives WordPress a public API for content distribution across multiple platforms and devices Makes creating and using custom posts types and taxonomies easy Focuses heavily on the publishing of a wide variety of content types (videos, books, events, reviews, authors, contacts, etc.) Enables strong social media integration through a urlshortner, social sharing links, and a social sharing toolbar Enables content aggregation from across the web into a local news feed Enables content bookmarking by logged-in users Extends WordPress through hooks, themes, and plugins, without the need to modify the core source code and/or database tables
WP + API = {        } Beta release coming soon: http://kickpress.org/getting-started/

More Related Content

What's hot

Working with newsfeeds
Working with newsfeedsWorking with newsfeeds
Working with newsfeeds
Euforic Services
 
Case Study: Wordpress as a CMS
Case Study: Wordpress as a CMSCase Study: Wordpress as a CMS
Case Study: Wordpress as a CMS
Kevin Codamon
 
Facebook & Twitter API
Facebook & Twitter APIFacebook & Twitter API
Facebook & Twitter API
Fabrice Delhoste
 
Firebase Services
Firebase ServicesFirebase Services
Firebase Services
Yasin Çetiner
 
Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020
Microsoft 365 Developer
 
Wordpress seo and digital marketing
Wordpress seo and digital marketingWordpress seo and digital marketing
Wordpress seo and digital marketing
Tapan Kapri
 

What's hot (7)

Working with newsfeeds
Working with newsfeedsWorking with newsfeeds
Working with newsfeeds
 
Case Study: Wordpress as a CMS
Case Study: Wordpress as a CMSCase Study: Wordpress as a CMS
Case Study: Wordpress as a CMS
 
Facebook & Twitter API
Facebook & Twitter APIFacebook & Twitter API
Facebook & Twitter API
 
Firebase Services
Firebase ServicesFirebase Services
Firebase Services
 
Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020
 
Wordpress seo and digital marketing
Wordpress seo and digital marketingWordpress seo and digital marketing
Wordpress seo and digital marketing
 
Drupal SEO
Drupal SEODrupal SEO
Drupal SEO
 

Viewers also liked

Fracciones lucero
Fracciones luceroFracciones lucero
Fracciones luceroMisslucero
 
Questions within senteces
Questions within sentecesQuestions within senteces
Questions within sentecesandylopeztriana
 
Bryan e bernardo
Bryan e bernardoBryan e bernardo
Bryan e bernardoninha25
 
Ioulia Klemens Introduction
Ioulia Klemens IntroductionIoulia Klemens Introduction
Ioulia Klemens Introduction
iklemens
 
Ahlan Ramadan presentation
Ahlan Ramadan presentationAhlan Ramadan presentation
Ahlan Ramadan presentation
bintMahmood
 
Bryan e bernardo
Bryan e bernardoBryan e bernardo
Bryan e bernardoninha25
 
Cuerposgeometricos1
Cuerposgeometricos1Cuerposgeometricos1
Cuerposgeometricos1Misslucero
 
Storycon
StoryconStorycon
Storycon
Storee1
 
Experis Overview
Experis OverviewExperis Overview
Experis Overviewcazkading
 
Are you suffering with a chronic condition
Are you suffering with a chronic conditionAre you suffering with a chronic condition
Are you suffering with a chronic conditionJohn Dewitt (LION)
 
"Push Button" Curation
"Push Button" Curation"Push Button" Curation
"Push Button" Curation
David Tufts
 
Hip hop’s expendable warriors
Hip hop’s expendable warriorsHip hop’s expendable warriors
Hip hop’s expendable warriorshayleycav1
 
How to Prevent Ebola and Some History
How to Prevent Ebola and Some HistoryHow to Prevent Ebola and Some History
How to Prevent Ebola and Some History
John Dewitt (LION)
 
andrea lopez triana javeriana cali english homework 2011-2
andrea lopez triana javeriana cali english homework 2011-2andrea lopez triana javeriana cali english homework 2011-2
andrea lopez triana javeriana cali english homework 2011-2andylopeztriana
 

Viewers also liked (20)

Reflections 3wb
Reflections 3wbReflections 3wb
Reflections 3wb
 
diplomovka
diplomovkadiplomovka
diplomovka
 
Fracciones lucero
Fracciones luceroFracciones lucero
Fracciones lucero
 
Phrasal verbs 2
Phrasal verbs 2Phrasal verbs 2
Phrasal verbs 2
 
Phrasal verbs 2
Phrasal verbs 2Phrasal verbs 2
Phrasal verbs 2
 
Questions within senteces
Questions within sentecesQuestions within senteces
Questions within senteces
 
Bryan e bernardo
Bryan e bernardoBryan e bernardo
Bryan e bernardo
 
False cognates al
False cognates alFalse cognates al
False cognates al
 
Ioulia Klemens Introduction
Ioulia Klemens IntroductionIoulia Klemens Introduction
Ioulia Klemens Introduction
 
False cognates al
False cognates alFalse cognates al
False cognates al
 
Ahlan Ramadan presentation
Ahlan Ramadan presentationAhlan Ramadan presentation
Ahlan Ramadan presentation
 
Bryan e bernardo
Bryan e bernardoBryan e bernardo
Bryan e bernardo
 
Cuerposgeometricos1
Cuerposgeometricos1Cuerposgeometricos1
Cuerposgeometricos1
 
Storycon
StoryconStorycon
Storycon
 
Experis Overview
Experis OverviewExperis Overview
Experis Overview
 
Are you suffering with a chronic condition
Are you suffering with a chronic conditionAre you suffering with a chronic condition
Are you suffering with a chronic condition
 
"Push Button" Curation
"Push Button" Curation"Push Button" Curation
"Push Button" Curation
 
Hip hop’s expendable warriors
Hip hop’s expendable warriorsHip hop’s expendable warriors
Hip hop’s expendable warriors
 
How to Prevent Ebola and Some History
How to Prevent Ebola and Some HistoryHow to Prevent Ebola and Some History
How to Prevent Ebola and Some History
 
andrea lopez triana javeriana cali english homework 2011-2
andrea lopez triana javeriana cali english homework 2011-2andrea lopez triana javeriana cali english homework 2011-2
andrea lopez triana javeriana cali english homework 2011-2
 

Similar to Beyond the Theme - Using WordPress as an API

O'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorialO'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorialTom Hofte
 
Using WordPress as a web application platform
Using WordPress as a web application platformUsing WordPress as a web application platform
Using WordPress as a web application platform
Joe Querin
 
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClassECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
European Collaboration Summit
 
Word press
Word pressWord press
Word pressgayath3
 
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
Evan Mullins
 
Wordpress
WordpressWordpress
Wordpress
eurosigdoc acm
 
WordPress REST API
WordPress REST APIWordPress REST API
WordPress REST API
Anthony Montalbano
 
REST based API
REST based APIREST based API
REST based API
ijtsrd
 
Doing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to ProductivityDoing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to Productivitykevinreiss
 
Doing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to ProductivityDoing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to Productivity
guest3c5c731bc
 
Eden-Wordpress-Session
Eden-Wordpress-SessionEden-Wordpress-Session
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
Jonathan Ralton
 
Empowering NGI Media with Alfresco
Empowering NGI Media with AlfrescoEmpowering NGI Media with Alfresco
Empowering NGI Media with Alfresco
Jeff Potts
 
IBAT-Wordpress-Session
IBAT-Wordpress-SessionIBAT-Wordpress-Session
PoolParty Thesaurus Management - ISKO UK, London 2010
PoolParty Thesaurus Management - ISKO UK, London 2010PoolParty Thesaurus Management - ISKO UK, London 2010
PoolParty Thesaurus Management - ISKO UK, London 2010
Andreas Blumauer
 

Similar to Beyond the Theme - Using WordPress as an API (20)

O'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorialO'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorial
 
Using WordPress as a web application platform
Using WordPress as a web application platformUsing WordPress as a web application platform
Using WordPress as a web application platform
 
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClassECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
 
Word press
Word pressWord press
Word press
 
Word press
Word pressWord press
Word press
 
Word press
Word pressWord press
Word press
 
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
 
Wordpress
WordpressWordpress
Wordpress
 
WordPress REST API
WordPress REST APIWordPress REST API
WordPress REST API
 
Web 2.0
Web 2.0 Web 2.0
Web 2.0
 
REST based API
REST based APIREST based API
REST based API
 
Doing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to ProductivityDoing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to Productivity
 
Doing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to ProductivityDoing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to Productivity
 
Eden-Wordpress-Session
Eden-Wordpress-SessionEden-Wordpress-Session
Eden-Wordpress-Session
 
Wordpress
WordpressWordpress
Wordpress
 
Wordpress
WordpressWordpress
Wordpress
 
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
 
Empowering NGI Media with Alfresco
Empowering NGI Media with AlfrescoEmpowering NGI Media with Alfresco
Empowering NGI Media with Alfresco
 
IBAT-Wordpress-Session
IBAT-Wordpress-SessionIBAT-Wordpress-Session
IBAT-Wordpress-Session
 
PoolParty Thesaurus Management - ISKO UK, London 2010
PoolParty Thesaurus Management - ISKO UK, London 2010PoolParty Thesaurus Management - ISKO UK, London 2010
PoolParty Thesaurus Management - ISKO UK, London 2010
 

Recently uploaded

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 

Recently uploaded (20)

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 

Beyond the Theme - Using WordPress as an API

  • 1. Beyond the Theme Using WordPress as an API
  • 2. About Me Find me on online at: @davidscottufts facebook.com/davidscottufts linkedin.com/in/davidtufts davidscotttufts.com I’m not a WordPress guru, ninja, black-belt, author, blogger, consultant, or hacker I do use WordPress everywhere
  • 3. One Year of WordPress at Work Migrated 14 unique brand sites and over 40 unique domains in 7 languages to WordPress multi-site Our most popular brand’s average page views increased from 85,000 to 150,000 (over 130,000 daily emails, over 45,000 iPhone/iPad apps, and over 65,000 Facebook fans) Our online donations increased by 38% Reduced server footprint by 40% and our overhead costs decreased by 30% Development time, costs, and learning curve for new developers were also all significantly reduced
  • 4. Goals of a WordPress Based Web Strategy Have one install for multiple sites Allow for a single sign-on across a network of sites Use an API to allow for content to be easily accessible by other websites and mobile devices Integrate web, social, mobile, social bookmarking, and monetization strategies Aggregate and curate content from across the network of sites in one central stream Think globally—location and language matter
  • 5. Why WordPress It met the conditions of our web strategy It has multi-site capabilities It is open source (FREE) It is easy to migrate to It is easy to use It is easy to install and upgrade It is popular (15% of the web runs on WordPress) It is versatile
  • 6. Versatile you say? Extend it with themes and plugins Modify it with hooks Create custom post types Add custom fields Use custom taxonomies Specify post formats
  • 7. An Analogy—Part 1 The WordPress admin area is like a kitchen and you are the chef The WordPress plugins are like the kitchen appliances that make for a better cooking experience The WordPress theme is like the dining room where the content is laid out for consumption There is a one-to-one relationship between your content and its container, the theme
  • 8. Content vs. Container A WordPress theme exists only within the context of its container—the web browser Your content is consumed from within your website’s theme Your RSS feed is the only way in which your content can be consumed from outside your website’s theme
  • 9. How Do People Find Your Site Search engines index your content Searches point people to your site Users subscribe to your RSS feed Friends might link to your site Anyone can share your content on social networks
  • 10. Your Websites Current Sphere of Influence
  • 11. Introduction to APIs “An API (Application Programming Interface) is a way for two applications to talk to each other in a common language that both systems understand. An API essentially provides a structured way for applications to get content in a predictable, flexible, and powerful way.”
  • 12. Does WordPress have an API? WordPress has XML-RPC for data management at the admin level WordPress has multiple built-in APIs that allow developers to enhance WordPress through plugins and themes WordPress has a robust query string that enables content filtering through the URL WordPress has no end user API that allows for third-party development around your content
  • 13. What Can an API do for You? Allows you to have a single instance of your content and users distributed across multiple channels Allows developers to build third-party applications around your web-based content or service Allows you to enhance the user experience within the context of your site by building an AJAX rich application
  • 14. Separating Content from Container WordPress separates the admin and plugins from the theme It allows for the content to exist independently of the website’s theme Modifying a site’s theme does not impact your content
  • 15. An Analogy—Part 2 Same kitchen, chef, appliances, and dining room as the earlier analogy An API turns your kitchen into a catering business with delivery trucks There is a one-to-many relationship between your content and multiple containers: mobile apps, third-party websites, and social networks
  • 16. Adding an API to WordPress Expands Your Sphere of Influence
  • 17. 3 Simple Steps to Implementing an API into Your Next WordPress Theme Pass additional query string parameters to the theme Modify the theme to process API calls Determine what format to return the content in
  • 18. Step 1: Pass Additional Query String Parameters to the Theme Define a query string parameter to specify whether or not the request being made is an API call. Always default the parameter to false in the theme as to not disrupt non API requests (?api=true) Define a query string parameter to specify in what format to return the content (&format=json)
  • 19. Step 2: Modify the Theme to Process API Calls <?php $api = $_GET[‘api’]; $f = $_GET[‘format’]; Section off the header and footer with conditional statements within files like index.php, single.php, archive.php, category.php, tag.php, and search.php Evaluate based on the query string parameters if an API call needs the header and footer If ( $api ) { // Conditional Header } // The Loop get_template_part(‘loop’, $f); If ( $api ) { // Conditional Footer } ?>
  • 20. Step 3: Determine What Format to Return the Content In Create a series of loops in different formats to handle your custom API requests: loop-html5.php, loop-json.php, loop-xml.php Allow the get_template_part() function to determine the appropriate format to use:get_template_part(‘loop’, $_GET[‘format’]);
  • 21. Example You have built an events management WordPress theme using custom post types for events, sessions, speakers, attendees, and venues. Now your conference attendees want to use their smart phones or tablets during an event to manage their schedules, rate sessions, etc.
  • 22. Allowing for Third-Party Development Every new “app” is just another instance of a group of your users interacting with your content or service Twitter would not be were it is today without an API which allows users and developers to interact with Twitter’s services on their terms
  • 23. Post Rank vs. Page Rank The tide is changing from searchability to shareability SEO is still be important, but what is more important is how accessible and shareable your content is from multiple devices, apps, and social networks
  • 24. Other API Implementation Ideas Use the API calls for AJAX reloading from within the context of the WordPress theme Use in conjunction with other query string parameters to determine the post type, posts per page, sort order, etc. Be sure to output the correct headers to the browser in the cases where the requested formats are like JSON, XML, or downloadable files
  • 25. Write It Yourself or Use KickPress The KickPressplugingives WordPress a public API for content distribution across multiple platforms and devices Makes creating and using custom posts types and taxonomies easy Focuses heavily on the publishing of a wide variety of content types (videos, books, events, reviews, authors, contacts, etc.) Enables strong social media integration through a urlshortner, social sharing links, and a social sharing toolbar Enables content aggregation from across the web into a local news feed Enables content bookmarking by logged-in users Extends WordPress through hooks, themes, and plugins, without the need to modify the core source code and/or database tables
  • 26. WP + API = { } Beta release coming soon: http://kickpress.org/getting-started/