引言
《iOS逆向》小程序的基础配置:文章的特色图片(缩略图/封面)模糊的解决方案:https://kunnan.blog.csdn.net/article/details/121471510
本文侧重于WordPress的配置。
I WordPress的基础配置
涉及的相关插件:
- Pods是一个用于创建,管理和部署自定义内容类型和字段的框架。
- 自定义插件:为REST API 接口新增返回字段,为iOS逆向小程序提供简化操作。

1.1 为REST API 接口新增返回字段
WordPress插件:给REST API新增文章特色图片(缩略图)字段
demo插件下载地址:https://download.csdn.net/download/u011018979/21981126

├── -dstrict.php 首页模块(精选栏目) ├── -friend.php 配置友情 ├── -watch.php 配置文件首页焦点 └── -xs.php 配置文章封面图片(文章特色图片)
文章的特色图片(缩略图/封面)模糊的解决方案:在wp后台的设置-媒体设置-缩略图大小 ,裁剪一个原始比例。当然你也可以设置0,表示不裁剪。
公众号头图尺寸比例是2.35:1,大概是900x383。

设置WordPress REST API : /components/api.js
export const Getfriend = API + '/wp-content/plugins/iosre-friend.php';
export const Getwatch = API + '/wp-content/plugins/iosre-watch.php';
export const Getdstrict = API + '/wp-content/plugins/iosre-dstrict.php';
插件例子:-dstrict.php
<?php
header('content-type:application/json');
$arr = array (
// 首页金刚区域 ,其中类型type分为以下情况
// 1.xs_default默认值跳二级
// 2.xs_tab跳转底部导航
// 3.xs_program跳转小程序
// 4.xs_business跳转业务域名请在route填写网站地址
// 5.xs_wxvideo_activity 打开视频号视频
// 6.xs_wxvideo_reserve_live 打开预约视频号直播
// 7.xs_wxvideo_live 打开视频号直播
[
array(
'title'=>'搜索',
'type'=>'xs_tap',
'appid'=>'',
'route'=>'/pages/search/search',
'himg'=>'../../static/index/1.png'
),
array(
'title'=>'友情',
'type'=>'xs_default',
'appid'=>'',
'route'=>'../friend/friend',
'himg'=>'../../static/index/dstrict-1.svg'
),
array(
'title'=>'视频号',
'type'=>'xs_wxvideo_activity',
'appid'=>'sphZH1M',//视频号 id,以“sph”开头的id,可在视频号助手获取
'route'=>'export/-4__wseALFi',//视频 feedId 就是视频链接
'himg'=>'../../static/data/ad_video.svg'
),
array(
'title'=>'商店',
'type'=>'xs_program',
'appid'=>'',
'route'=>'pages/index/index',
'himg'=>'../../static/data/renking-8.svg'
)
],
);
echo json_encode($arr);
?>
视频号助手:https://channels.weixin.qq.com/index

1.2 更新pods字段
升级pods插件:请注意备份数据,2.7.x升级2.8.x。
!(https://ucc.alicdn.com/images/user-upload-01/798c97ec0ff64e888a6e48ce079bfbe7.png)
在升级pods 2.8.8,在pods插件—-高级—-清除和重置中清理数据

开启Migrate: Packages
插件并重新导入pods字段:pods.html(或pods.json)
Import/Export your Pods, Fields, and other settings from any Pods site; Includes an API to Import/Export Packages via PHP
![]](https://ucc.alicdn.com/images/user-upload-01/44ea7eed5a64403c8cf9f54e886e4f61.png)

1.3 排序分类的顺序
直接在wordpress后台搜索Simple Custom Post Order插件
插件地址:https://wordpress.org/plugins/simple-custom-post-order
see also