最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

rest api - Where is the HTML content for my post in the API

programmeradmin1浏览0评论

I've been looking at the docs and tutorials online to find out if there's a way to get to the html content of my posts. For example, this endpoint gives me all the information related to one post, but not the actual HTML content, with its texts, links to videos. What is the endpoint for me to get to the meat of the post? I'm so befuddled. I would have thought this would be the most obvious thing in the world but I can't seem to find it!

I've been looking at the docs and tutorials online to find out if there's a way to get to the html content of my posts. For example, this endpoint gives me all the information related to one post, but not the actual HTML content, with its texts, links to videos. What is the endpoint for me to get to the meat of the post? I'm so befuddled. I would have thought this would be the most obvious thing in the world but I can't seem to find it!

Share Improve this question asked Jan 31, 2019 at 16:16 OctaviaLoOctaviaLo 1398 bronze badges 3
  • 1 What plugins do you use? It looks like the content of that post is empty - so maybe it's rendered some other way by your theme or some plugin... – Krzysiek Dróżdż Commented Jan 31, 2019 at 16:22
  • Right... that could be. I'll try the API with a fresh install. Thanks for the hint! – OctaviaLo Commented Jan 31, 2019 at 16:33
  • If you're using a plugin such as WP Bakery or Advanced Custom Fields, they store the content outside of WordPress's actual post_content field. Some of these plugins have ways to expose their content through the REST API such as additional plugins that "connect" the information. – WebElaine Commented Jan 31, 2019 at 17:11
Add a comment  | 

1 Answer 1

Reset to default -1

you can use below property from return JSON object

post.content.rendered
发布评论

评论列表(0)

  1. 暂无评论