WordPress version of wechat app version 2.0 released

Time:2021-6-9

We use our spare time to upgrade the wechat app of WordPress version, add some functions, and optimize the performance of the program. After this version upgrade, the basic functions required by the WordPress version of wechat applet have been provided.

Open source address:https://github.com/iamxjb/win…

WordPress version of wechat app version 2.0 released

WordPress version of wechat app version 2.0 released

The main adjustment and optimization functions of this upgrade include:

1. Adjust the display mode of the list page

The list page is no longer displayed in the way of summary, but in the way of thumbnail + title, which is more suitable for browsing in wechat.
WordPress version of wechat app version 2.0 released

2. Add search

The article search of WordPress rest API is full-text. The link to call the API is as follows:

https://www.watch-life.net/wp…*
The search input box is in the sideslip menu
WordPress version of wechat app version 2.0 released

3. Add carousel pictures and thumbnails to the home page

Carousel images and list thumbnails are the first article of the article content used. If there is no image, the default image is used. The reason why we use this way to get pictures is mainly to write interface program based on native WordPress rest API to increase the versatility of the program.

If there are no top articles, we will get the top 5 articles in the latest 30 comments.

4. Add comments

Show comments on the article content page and submit comments. Because WordPress rest API forbids anonymous comments by default, it is necessary to enable the anonymous comment function of rest API. The specific method is to add the following code in the functions.php file of the theme of WordPress:

function filter_rest_allow_anonymous_comments() {
return true;
}
add_filter(‘rest_allow_anonymous_comments’,’filter_rest_allow_anonymous_comments’);
Opening the rest API anonymous comment function will bring some risks to WordPress website, because it may lead to the increase of spam comments. Subsequent version updates will consider submitting comments through the security verification mechanism of WordPress rest API.

WordPress version of wechat app version 2.0 released

5. Add small program sharing

By clicking the three points in the upper right corner of wechat and selecting “forward” in the open menu, you can share wechat applets with wechat groups and friends, which is conducive to the promotion of wechat applets.

WordPress version of wechat app version 2.0 released

WordPress version of wechat app version 2.0 released
If a friend wants to participate in the development of this small program, or put forward suggestions on the functions of this small program, welcome to add my wechat, or join the wechat group for discussion

My micro signal: iamxjb, the two-dimensional code is as follows:

WordPress version of wechat app version 2.0 released

Address of this article:https://www.watch-life.net/wo…