SlideShare a Scribd company logo
Isotope,
WP REST API,
and AJAX
oh my!
An example in the wild...
About me:
Name:
Austin Gil
Work:
Visceral (https://thisisvisceral.com)
“We craft brands and experiences for the
world’s leading causes”
Position:
Lead Developer
WP Experience:
3 years
Recent Project Using Rest API
Healthy Newborn Network - http://www.healthynewbornnetwork.org/
Process:
1. get_posts() shows initial posts and sets up array of IDs for posts to load.
2. Create gallery markup using Isotope for animations and filters.
3. When a filter is clicked, WP REST API sets up post objects based on IDs
4. AJAX takes the data from the REST API and loads it
The toolbox:
Not necessary to know, but helpful for understanding.
Isotope - http://isotope.metafizzy.co/
WP REST API - http://v2.wp-api.org/
jQuery AJAX - http://api.jquery.com/jquery.ajax/
get_posts()
Isotope markup
WP REST API
Default location:
/wp-json/wp/v2/posts
https://dev-hnn.thisisvisceral.com/wp-json/wp/v2/posts
Add WP Query filters such as posts_per_page:
?filter[posts_per_page]=1
https://dev-hnn.thisisvisceral.com/wp-json/wp/v2/posts?filter[posts_per_page]=1
AJAX
Gotchas...
Doesn’t support certain fields
Featured image
Author details
Advanced Custom Fields
Custom post types
Not supported by default. Going to /wp-json/wp/v2/custom-post-type did
not work.
Must be enabled when registering post types.
Apply filters with “rest_prepare_(your post type)”
Why not wp_ajax()...?
So why all the fuss…?
REST API makes it possible to build a separate application and
access data in a WP site.
That means we can build with any language: PHP, Ruby, Python,
Node, Angular, React....
...even static HTML
http://localhost/restwp/index.html
Useful Tools:
console.log(allTheThings)
JSON browser extension - Chrome JSONView
https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihc
kbnefhakgolnmc?hl=en

More Related Content

PDF
TYPO3 6.2 for extension developer
Nicole Cordes
 
PPTX
Download alice
barkeshli
 
KEY
Amazon Ec2
snusmumrik
 
PDF
「Code igniter」を読もう。〜ソースコードから知る仕様や拡張方法〜
Makoto Kaga
 
PDF
Web Scraping is BS
John D
 
PPT
WordPress Security - WordCamp Boston 2010
Brad Williams
 
PDF
Week5 컴포넌트 스캔
Covenant Ko
 
PDF
Bảo Mật Website WordPress
Lê Quốc Toàn
 
TYPO3 6.2 for extension developer
Nicole Cordes
 
Download alice
barkeshli
 
Amazon Ec2
snusmumrik
 
「Code igniter」を読もう。〜ソースコードから知る仕様や拡張方法〜
Makoto Kaga
 
Web Scraping is BS
John D
 
WordPress Security - WordCamp Boston 2010
Brad Williams
 
Week5 컴포넌트 스캔
Covenant Ko
 
Bảo Mật Website WordPress
Lê Quốc Toàn
 

Similar to Isotope, WP REST API, and AJAX...Oh my! (20)

PDF
IPaste SDK v.1.0
xrebyc
 
PDF
Open social for science a sciverse primer - mysimplesearch
remko caprio
 
PPT
OpenSocial Intro
Pamela Fox
 
PPT
Yahoo! Application Platform Technical Deep Dive
Tony Ng
 
PPT
Rails 101
The Active Network
 
PPT
MySpace Open Platform enhancements with OpenSocial 0.9
MySpaceDevTeam
 
PDF
StackMob & Appcelerator Module Part One
Aaron Saunders
 
PDF
JSON REST API for WordPress
Taylor Lovett
 
PPTX
IIIF without an image server? No problem!
Simeon Warner
 
ODP
Apache Aries Blog Sample
Skills Matter
 
PDF
2-0. Spring ecosytem.pdf
DeoDuaNaoHet
 
PPT
YAP / Open Mail Overview
Jonathan LeBlanc
 
PPT
Creating a New iSites Tool
Harvard Web Working Group
 
PDF
Jaoo - Open Social A Standard For The Social Web
Patrick Chanezon
 
PPTX
Building mobile apps using Phonegap
Mohammad Shoriful Islam Ronju
 
PDF
How to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdf
Be Problem Solver
 
PPT
Meetup uikit programming
joaopmaia
 
PDF
Unleash the power of HTTP with ASP.NET Web API
Filip W
 
PPT
SEA Open Hack - YAP
Jonathan LeBlanc
 
PPT
Open social
Tushar Gandhi
 
IPaste SDK v.1.0
xrebyc
 
Open social for science a sciverse primer - mysimplesearch
remko caprio
 
OpenSocial Intro
Pamela Fox
 
Yahoo! Application Platform Technical Deep Dive
Tony Ng
 
MySpace Open Platform enhancements with OpenSocial 0.9
MySpaceDevTeam
 
StackMob & Appcelerator Module Part One
Aaron Saunders
 
JSON REST API for WordPress
Taylor Lovett
 
IIIF without an image server? No problem!
Simeon Warner
 
Apache Aries Blog Sample
Skills Matter
 
2-0. Spring ecosytem.pdf
DeoDuaNaoHet
 
YAP / Open Mail Overview
Jonathan LeBlanc
 
Creating a New iSites Tool
Harvard Web Working Group
 
Jaoo - Open Social A Standard For The Social Web
Patrick Chanezon
 
Building mobile apps using Phonegap
Mohammad Shoriful Islam Ronju
 
How to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdf
Be Problem Solver
 
Meetup uikit programming
joaopmaia
 
Unleash the power of HTTP with ASP.NET Web API
Filip W
 
SEA Open Hack - YAP
Jonathan LeBlanc
 
Open social
Tushar Gandhi
 
Ad

More from Austin Gil (8)

PDF
What I like about vue
Austin Gil
 
PDF
Functional Components in Vue.js
Austin Gil
 
PPTX
Enterprise level application in 5 min
Austin Gil
 
PDF
Content Security Policy
Austin Gil
 
PPTX
Developing word press professionally
Austin Gil
 
PPTX
A holistic approach to web performance
Austin Gil
 
PPTX
Web Performance: 3 Stages to Success
Austin Gil
 
PDF
Improve WordPress load times with a CDN
Austin Gil
 
What I like about vue
Austin Gil
 
Functional Components in Vue.js
Austin Gil
 
Enterprise level application in 5 min
Austin Gil
 
Content Security Policy
Austin Gil
 
Developing word press professionally
Austin Gil
 
A holistic approach to web performance
Austin Gil
 
Web Performance: 3 Stages to Success
Austin Gil
 
Improve WordPress load times with a CDN
Austin Gil
 
Ad

Recently uploaded (20)

PPTX
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
PDF
Data Protection & Resilience in Focus.pdf
AmyPoblete3
 
PPTX
EthicalHack{aksdladlsfsamnookfmnakoasjd}.pptx
dagarabull
 
PDF
Latest Scam Shocking the USA in 2025.pdf
onlinescamreport4
 
PPTX
ppt lighfrsefsefesfesfsefsefsefsefserrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrt.pptx
atharvawafgaonkar
 
PDF
LOGENVIDAD DANNYFGRETRRTTRRRTRRRRRRRRR.pdf
juan456ytpro
 
PPTX
Different Generation Of Computers .pptx
divcoder9507
 
PPTX
Perkembangan Perangkat jaringan komputer dan telekomunikasi 3.pptx
Prayudha3
 
PPT
Introduction to dns domain name syst.ppt
MUHAMMADKAVISHSHABAN
 
PPTX
The Monk and the Sadhurr and the story of how
BeshoyGirgis2
 
PPTX
AI ad its imp i military life read it ag
ShwetaBharti31
 
PPTX
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
PPTX
The Latest Scam Shocking the USA in 2025.pptx
onlinescamreport4
 
PDF
Project English Paja Jara Alejandro.jpdf
AlejandroAlonsoPajaJ
 
PDF
5g is Reshaping the Competitive Landscape
Stellarix
 
PPT
Transformaciones de las funciones elementales.ppt
rirosel211
 
PDF
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
PPTX
Unlocking Hope : How Crypto Recovery Services Can Reclaim Your Lost Funds
lionsgate network
 
PPTX
B2B_Ecommerce_Internship_Simranpreet.pptx
LipakshiJindal
 
PPTX
Slides Powerpoint: Eco Economic Epochs.pptx
Steven McGee
 
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
Data Protection & Resilience in Focus.pdf
AmyPoblete3
 
EthicalHack{aksdladlsfsamnookfmnakoasjd}.pptx
dagarabull
 
Latest Scam Shocking the USA in 2025.pdf
onlinescamreport4
 
ppt lighfrsefsefesfesfsefsefsefsefserrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrt.pptx
atharvawafgaonkar
 
LOGENVIDAD DANNYFGRETRRTTRRRTRRRRRRRRR.pdf
juan456ytpro
 
Different Generation Of Computers .pptx
divcoder9507
 
Perkembangan Perangkat jaringan komputer dan telekomunikasi 3.pptx
Prayudha3
 
Introduction to dns domain name syst.ppt
MUHAMMADKAVISHSHABAN
 
The Monk and the Sadhurr and the story of how
BeshoyGirgis2
 
AI ad its imp i military life read it ag
ShwetaBharti31
 
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
The Latest Scam Shocking the USA in 2025.pptx
onlinescamreport4
 
Project English Paja Jara Alejandro.jpdf
AlejandroAlonsoPajaJ
 
5g is Reshaping the Competitive Landscape
Stellarix
 
Transformaciones de las funciones elementales.ppt
rirosel211
 
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
Unlocking Hope : How Crypto Recovery Services Can Reclaim Your Lost Funds
lionsgate network
 
B2B_Ecommerce_Internship_Simranpreet.pptx
LipakshiJindal
 
Slides Powerpoint: Eco Economic Epochs.pptx
Steven McGee
 

Isotope, WP REST API, and AJAX...Oh my!

  • 1. Isotope, WP REST API, and AJAX oh my! An example in the wild...
  • 2. About me: Name: Austin Gil Work: Visceral (https://thisisvisceral.com) “We craft brands and experiences for the world’s leading causes” Position: Lead Developer WP Experience: 3 years
  • 3. Recent Project Using Rest API Healthy Newborn Network - http://www.healthynewbornnetwork.org/
  • 4. Process: 1. get_posts() shows initial posts and sets up array of IDs for posts to load. 2. Create gallery markup using Isotope for animations and filters. 3. When a filter is clicked, WP REST API sets up post objects based on IDs 4. AJAX takes the data from the REST API and loads it
  • 5. The toolbox: Not necessary to know, but helpful for understanding. Isotope - http://isotope.metafizzy.co/ WP REST API - http://v2.wp-api.org/ jQuery AJAX - http://api.jquery.com/jquery.ajax/
  • 8. WP REST API Default location: /wp-json/wp/v2/posts https://dev-hnn.thisisvisceral.com/wp-json/wp/v2/posts Add WP Query filters such as posts_per_page: ?filter[posts_per_page]=1 https://dev-hnn.thisisvisceral.com/wp-json/wp/v2/posts?filter[posts_per_page]=1
  • 11. Doesn’t support certain fields Featured image Author details Advanced Custom Fields
  • 12. Custom post types Not supported by default. Going to /wp-json/wp/v2/custom-post-type did not work. Must be enabled when registering post types. Apply filters with “rest_prepare_(your post type)”
  • 14. So why all the fuss…?
  • 15. REST API makes it possible to build a separate application and access data in a WP site. That means we can build with any language: PHP, Ruby, Python, Node, Angular, React.... ...even static HTML http://localhost/restwp/index.html
  • 16. Useful Tools: console.log(allTheThings) JSON browser extension - Chrome JSONView https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihc kbnefhakgolnmc?hl=en