WordPress獲取文章列表

要在你的站點上使用該接口,請參閱:WordPress接口大全(sliverRingApi):輕鬆構建你自己的任何項目

接口說明

  1. 兩種展示方式,一種純文章列表,一種以分類爲組的方式,足以滿足大多數項目佈局需求。
  2. 可以自定義meta值
  3. 多種排除方式,要展示什麼文章隨你選擇。
  4. 返回值中帶有大多數需求的值,比如摘要、縮略圖、標籤、分類
  5. 可以用來做app、小程序、H5等項目首頁

CMS多功能版

1)、接口地址

https://www.inacorner.top/sliverRingApi/hundred/v1/home

2)、所傳參數

type(int)必傳:展示列表形式,1爲常規列表,2爲多分類列表。如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1

cat(string):type爲2時必傳參數,返回值會以分類爲組的方式展示,用英文逗號分隔。如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=2&cat=73,76

page(int)可選:type爲2時默認不含此參數,頁數,第幾頁。如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&page=2

number(int) 可選:每頁展示多少條,默認爲wp設置中的值,如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&page=2&number=5

orderby(string)可選:排序方式,默認爲時間(可選參數有date、ID、author、title、rand、comment_count、自定義字段值),如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&page=2&number=5&orderby=ID

if_cat 可選:是否在列表中顯示文章所屬分類,不傳則不查詢,如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&if_cat=1

if_tag 可選:是否在列表中顯示文章標籤,不傳則不查詢,如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&if_tag=1

order(string) 可選:是怎麼排序,從大到小還是從小到大,支持ASC、DESC。如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&page=2&number=5&orderby=ID&order=ASC

meta(string) 可選:要在列表中展示的自定義字段,用英文逗號分割,如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&page=2&number=5&orderby=ID&order=ASC&meta=_edit_lock,_edit_last

excludeCat(string)可選:要在列表中排除的分類(ID),用英文逗號分隔,如
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&excludeCat=76,28

excludeTag(string)可選:要在列表中排除的標籤(ID),用英文逗號分隔,如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&excludeTag=6

excludePost(string)可選: 要在列表中排除的文章(ID),用英文逗號分隔,如:
https://www.inacorner.top/sliverRingApi/hundred/v1/home?type=1&excludePost=722,705

3)、請求方法:GET

4)、返回值太多就不一一解釋了,大家自己看接口吧,看不懂的留言或直接找我

個人博客版本

1)、接口地址

https://www.inacorner.top/sliverRingApi/fifty/v1/home

2)、所傳參數:與贊助148以上的相比沒有type,只有一種展示類型,其他一致。

3)、請求方法:GET

4)、返回值太多就不一一解釋了,大家自己看接口吧,看不懂的留言或直接找我

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章