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?
- Send post to remote wp site from post edit window with all data excerpt image
- WordPress REST API – Create post not working with 401 response but list posts working
- REST API – Retrieving posts with custom status
- Cannot create posts via REST API
- WordPress custom post_status after 6.6 version
- Replacing all attachment links in post with media file link
- How to retrieve the postID in a “image_send_to_editor” hook function?
- Post revisions disappeared (for some posts)
- Replace ‘published on date’ with ‘modified on date’ on Posts
- How to display category from recent posts?
- Set size for attachments
- Adding an image to a non existing post
- Update Post Meta is adding a value to my serialize array
- HTML Form Submit to table in same page
- how many visitor open this post? [closed]
- Prevent Archive URLs
- Dev and prod on the same database- dev version active for IOS
- Update user meta when post published no working
- Latest posts on all pages
- Display all posts from selected month
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?