引言
- WordPress的配置。
- 小程序资讯相关类目暂不对个人开放,导致大批个体小程序被暂停服务的解决方案
I WordPress的基础配置
涉及的相关插件:
- Pods是一个用于创建,管理和部署自定义内容类型和字段的框架。
- 自定义插件:为REST API 接口新增返回字段,为iOS逆向小程序提供简化操作。
1.1 为REST API 接口新增返回字段
WordPress插件:给REST API新增文章特色图片(缩略图)字段
├── -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);
?>
1.2 更新pods字段
升级pods插件:请注意备份数据,2.7.x升级2.8.x。
在升级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
1.3 排序分类的顺序
直接在wordpress后台搜索Simple Custom Post Order插件
插件地址:https://wordpress.org/plugins/simple-custom-post-order
II 小程序的基础配置
小程序的基础配置
2.1 资讯相关类目的被暂停服务解决方案
由于小程序资讯相关类目迭代更新将于 2022 年 7 月 12 日生效,规定资讯-信息资讯类目暂不对个人开放,导致大批个体小程序被暂停服务,需要开发者请下架涉及资质类目的运营内容。
由于本人的小程序类目选择了教育服务,分享图文文章也中招了
标签:Serverless,插件,..,程序,API,WordPress,xs,php,下载 From: https://blog.51cto.com/iosre/5797924