Resolved!
If no feature image exists, then _embedded[‘wp:featuredmedia’] is not used.
To resolve, the prop value needs to be wrapped into a conditional.
<Post
key={post?.id}
id={post?.id}
title = {post?.title.rendered}
link = {post?.link}
img = {post && post._embedded && post._embedded['wp:featuredmedia'] ? post._embedded['wp:featuredmedia'][0].source_url : ' ' }
category = {post?.categories}
/>
Related Posts:
- Get post from custom REST endpoint in Gutenberg
- Loading posts outside wordpress
- Keyboard shortcut for updating a page or post?
- How to add category to: ‘wp-admin/post-new.php’?
- Ajax Load More Posts in Category Page
- Get the current post ID as a variable in Javascript
- How to create WP Editor using javascript
- WP Rest API v2 filter and display latest post with specific tag
- Dynamically update post title in admin page
- WP REST API, query total posts in a category
- Add javascript when post is published
- WordPress Rest API – Get all posts based on post_meta on custom endpoint
- Disable REST API for a user ROLE
- Add confirmation popup on “Move to Trash”
- ping_status in JSON REST API
- Create a separate JS application for an individual post?
- WordPress blog posts api – get posts by author
- WP rest api returns 404 only when author param is used
- Convert a complex webpage into WP theme
- Add scripts on custom post add/edit pages Not Working
- Injecting JavaScript into a Post with WP3.x
- Exclude posts w/ specific post_meta on Rest API endpoint
- How can I get a post field value using javascript?
- Add ajax load more function using WP API
- Transfer WordPress post to RoR site: is the REST Api the only and/or best solution?
- WordPress REST API not returning all posts
- Custom post preview without saving
- Exclude post_meta from Rest API Endpoint
- Block Editor: Reset Reusable Blocks to last saved record
- WP Remote Request not returning all of content via request
- Get more than one author’s posts with REST API
- How to create a post using REST API with sending data as a JSON body?
- How can I get the media inside a post?
- WordPress Rest API Create Post
- Ajaxify This Code
- Integrate OpenStreetMap on WordPress
- Only show a Post once in 10 visits
- Call Web Services on post first publish
- In post.php how can I remove onbeforeunload?
- Getting featured image with PHP and not javascript from wordpress api _embed [closed]
- search blog posts by author first name and or last name
- Creating a WordPress Post via REST API – HTML or Markdown?
- How to get post with associated categories and tags names instead of ids with rest api?
- Navigate through the posts using keyboard arrows
- What date to use as a post date? date_gmt or modified_date_gmt
- Custom wp-query in wordpress rest api
- Call current post URL in ajax
- Get content from WordPress posts in Boostrap modal window – Javascript side?
- Insert specific information to a posts of a predefined category
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- Using the loop to set locations for all posts on a single google map
- Insert JavaScript in a blog post or a new page?
- Filter out posts based on a certain post_meta on the WordPress REST API
- Optimal WP Web App Backend for mobile app development
- Delete Post but retain image of post [WP REST API]
- Pull in posts using post meta for REST API
- Rest API Paginate until all posts are imported
- Add a field in my rest api
- Why is it recommended to insert JS through the theme, plugin, etc rather than in the post directly?
- WordPress React re-rendering to many times
- How do I assign an attachment to a post using only the REST API?
- WordPress rest API get Posts parent by post ID
- Updating post status via rest api
- exclude particular category in api
- Weird problem occurs while using WordPress REST API to create new post
- How to set the post permalink using the WordPress REST API?
- How to prevent post update using transition_post_status
- REST API Working for GET but not for POST?
- Ajax post doesnt call succes after got the response
- Blog Post slider not working
- Colorbox not working on native WordPress gallery when gallery is loaded thru AJAX
- testing result of $.post with json_encode
- How to create REST Based JSON API(how to modify the code below)?
- Best Way to detect unique posts in wp rest api
- Front end post delete error confirmation and success message
- How to hide a script ( an ad) from a specific post? [closed]
- Changes done in admin panel are taking time to reflect in the REST api responses
- How can I add a custom caclulation form in post?
- How do I save JS classes being applied to the WP dashboard via custom plugin?
- Let private posts stay in status “private” after edit through “editors”
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Display most recent post in category instead of archive?
- Display the latest posts, published in the last hour, with WP_Query
- Server-side sorting of posts
- How do I exclude the current post from listing in recent posts
- Custom post types related to same custom post type?
- How To capitalize The First Letter Of Every Word In The Post Title
- Show post content and title in diferent divs using WP_Query using a loop
- Reinstall WordPress while keeping attachments
- Custom WP_Query not working correctly
- created post displaying differently on front end
- MYSQL: Create SQL query to search for string and replace
- WordPress empty page! what is wrong with this code?
- How to display max. 2 sticky posts when posts_per_page is 3?
- Count posts for pagination
- Add review box by function at top or bottom of content
- Custom Post Type doesn’t use single.php or single-{custom_post_type}.php
- Display all posts/pages in a multiple selectbox
- How to only allow post to be deleted if custom field doesn’t exist
- How to move all images in a post to a single gallery for a bunch of posts?