要在你的站点上使用该接口,请参阅:WordPress接口大全(sliverRingApi):轻松构建你自己的任何项目
接口说明
- 两种展示方式,一种纯文章列表,一种以分类为组的方式,足以满足大多数项目布局需求。
- 可以自定义meta值
- 多种排除方式,要展示什么文章随你选择。
- 返回值中带有大多数需求的值,比如摘要、缩略图、标签、分类
- 可以用来做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)、返回值太多就不一一解释了,大家自己看接口吧,看不懂的留言或直接找我