dtqf81594 2018-12-11 23:19
浏览 78
已采纳

如何使用REST api从特定类别发布帖子

I am using rest API to get the post from a specific Category. but from this URL http://example.com/wp-json/wp/v2/categories/?slug=category_name I am only getting the category name, not the post.

and by using this link

Check this link

I am getting all the post but not getting the featured image in that post.

note: I am using the better-featured image

  • 写回答

2条回答 默认 最新

  • doubeiji2602 2018-12-12 00:19
    关注

    You have to use the category ID. Example: http://example.com/wp-json/wp/v2/posts?categories=3160

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部