我的网站

wordpress常用函数

get_category_link(x) x为分类id,获取x的分类链接get_permalink(x) x为post id,获取post链接

wordpress去掉url中的category

wordpress去掉url中的category,可以使用No Category Base这个插件

wordpress修改文章url

网站从织梦搬迁至wordpress,原来的文章url没有顶级目录,在wordpress设置固定链接,自定义链接后,%category% 会显示文章所在的全部目录,现在要去掉顶级目录,搜索一番,找到Custom Permalinks 插件,然后进入文章再次设置下url就可以了

Wordpress: WP Rest API - 如何获取特色图片(缩略图) featured image

给api后加 _embed url: 'https://www.xalhsz.cn/wp-json/wp/v2/doctor?_embed' {{item._embedded['wp:featuredmedia'][0].source_url}} //微信小程序中如此调用 2. 在functions.php中加如下代码 function post_fea

小程序 富文本解析方式 rich-text

通过api获取的文章内容显示有html标签,百度搜索小程序富文本解析,有搜到wxParse-微信小程序富文本解析组件,结果发现rich-text就可以解析富文本啊,nice

微信小程序web-view跳转到网页

首先,配置web-view业务域名 <block wx:for="{{list}}" wx:key="index"> <view class="wditem" bindtap="gotolink" data-webview="{{item.link}}"> <image src="{{item.featured_media_src_url}}" c

一种Git冲突:commit your changes or stash them before you can merge 解决方法

1. 现象 Please, commit your changes or stash them before you can merge.     出现这个问题的原因是其他人修改了已被Git追踪的文件并提交到版本库中去了,而你本地也修改了改文件,但是你事先忘记pull了,此时进行git pull操作就好出现冲突了,解决方法,在上面的提示中也说的很明确了。 (1)保留本地的修改

TypeError: Cannot read property 'setData' of undefined

success: function (res) { this.setData({}) } 改成如下: success: (res) => { this.setData({}) } 【原因分析】为什么呢?因为两种写法this指向不同。 success: (res) => { console.log("(res) => { }时:" + thi

wordpress api获取文章缩略图,特色图片Featured Image

wordpress api获取文章缩略图,特色图片Featured Image,安装插件REST API Featured Image 后便可以,如下图显示:

wordpress安装插件提示需要ftp服务

wordpress安装插件提示需要ftp服务,其实不是真的需要安装ftp服务,只要修改wordpress配置即可。 在wordpress安装目录中找到wp-config.php文件,在文件中添加以下代码: define("FS_METHOD","direct"); define("FS_CHMOD_DIR", 0777); define("FS_CHMOD_FILE", 0777);