LoginSignup
1
0

More than 1 year has passed since last update.

WordPressのREST APIで投稿をslugから取得する方法

Last updated at Posted at 2019-07-11

WordPressのREST APIで投稿をslugから取得する方法

https://example.com/wp-json/wp/v2/posts/?slug=<slug>
が使えます。

下のブログはWordPressで構築されたブログの1記事です。
https://toshioakaneya.com/school-report-release/

WordPressのREST APIによりこの投稿のslugから記事の情報を取得するには、以下のパスを使用します。
https://toshioakaneya.com/wp-json/wp/v2/posts/?slug=school-report-release

終わりに

私は現在、Web3のサービスの開発をしています。詳しくはこちらの記事をご覧下さい。
無料でイーサリアムが当たる、Web3時代の寄付サイトを作った話

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0