[WORDPRESS API] How to Get Featured Image from WordPress REST API (ok)
https://medium.com/@dalenguyen/how-to-get-featured-image-from-wordpress-rest-api-5e023b9896c6
Last updated
Was this helpful?
https://medium.com/@dalenguyen/how-to-get-featured-image-from-wordpress-rest-api-5e023b9896c6
Last updated
Was this helpful?
Dale NguyenFollowMar 31, 2018 · 1 min read
There is a time when I have to get a featured image from WordPress REST API. It’s quite strange that the first place when REST API document doesn’t return the featured image by default which is something that should have done in first place.
Luckily, there are few ways that you can get the featured image after calling the REST API.
Method 1: Use Better REST API featured images plugin. I don’t recommend to use this plugin unless you are super lazy.
Method 2: Add ?_embed at the end of the URL. Take a look at the example below
Your featured image is in:
Method 3: Add featured image directly to REST API. You can do it by editing functions.php file or creating a plugin for this. (Credit to my boss :D)
I will update frequently uses wordpress snippets to my git: https://github.com/dalenguyen/wordpress-snippets