From the course: WordPress: REST API
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Find posts in a category - WordPress Tutorial
From the course: WordPress: REST API
Solution: Find posts in a category
(upbeat music) - [Instructor] Welcome back, did you find the answer? This challenge forces you to think carefully about how the REST API works and what it tells you. So if you had a bit of trouble, that's to be expected. There are several solutions to this challenge, some of them are more labor intensive than others, so let me walk you through what I think is the most straightforward one, and explain my thought process while doing it. Remember in the challenge, I say you need to find the posts that are filed under the category with the description posts that have media-related tests. The trouble is, we can't really query the REST API for a category based on it's description, so instead we need to go look at all the categories, and then find the category with the right description, and then go from that category to find out which posts are filed under it. And all of that is possible with the REST API, you just have to do it…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
What is the WordPress REST API?2m 42s
-
(Locked)
What are RESTful APIs and JSON?2m 16s
-
(Locked)
Routes and endpoints1m 43s
-
(Locked)
Communicating with the REST API4m 16s
-
(Locked)
Explore the REST API response7m 23s
-
(Locked)
Useful routes: A quick reference5m 8s
-
(Locked)
Expanding the response with embeds6m 14s
-
(Locked)
Challenge: Find posts in a category2m
-
(Locked)
Solution: Find posts in a category5m 18s
-
-
-
-
-