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)、返回值太多就不一一解释了,大家自己看接口吧,看不懂的留言或直接找我

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值