当前位置:网站首页>WordPress plugin - display posts
WordPress plugin - display posts
2022-04-21 07:22:00 【Landscape Shepherd】
Catalog
3、 ... and 、 Plug in installation
5、 ... and 、 Examples of scenes - Personnel introduction
6、 ... and 、 Other scenarios expand
One 、 Introduce
Display Posts yes WordPress plug-in unit , You can use short code (shortcodes), Realize the right article (posts) Fast operation of .
Supported operations include filtering ( Category 、 label 、 Article type or other )、 Sorting results 、 List etc. .
Plug in website
Two 、 Realization principle
WP_Query yes WordPress A class provided , Support various parameters and methods , By combination , All article queries can be implemented through this class .
Display Posts It's right WP_Query The advanced packaging of , There's no need to master complex WP_Query Result filtering can be realized .
3、 ... and 、 Plug in installation
Search the plug-in management page Display Posts, Can be installed .
Or manually copy the file to the plug-in Directory .
Four 、 Basic grammar
[display-posts]
If you need to filter , You can add filter criteria .
Filter by category
[display-posts category="news"]
Filter by tag
[display-posts tag="news"]
Include article, show article content
[display-posts tag="news" include_content="true"]
Sort
[display-posts orderby="comment_count"]
5、 ... and 、 Examples of scenes - Personnel introduction
Prepare the environment , Create articles (posts).
- The content of the article is an introduction to .
- The article category is personnel introduction .
- Article labels are project support group and technical support or project manager .
- The title of the article is the name of the introduced person .
- This kind of article is 4 piece .
These people need to show... On the project support group home page , But I don't want to edit this page manually every time the staff changes .
The following is an example :

6、 ... and 、 Other scenarios expand
Use simple code , Can be very convenient to achieve the article (posts) The exhibition of , At the same time, the input and display of content are separated , As long as the article is labeled 、 classification , In the future, we can arbitrarily combine the required content according to the situation . Such as : Personnel introduction . adopt [display-posts category=" Personnel introduction "] That is to say , Instead of editing a page , Copy everyone's hyperlinks one by one .
Empathy , The same is true of other articles . Like documents 、 manual 、 Skills, etc .
Reference resources
For more usage, please refer to the official documents
https://displayposts.com/docs/parameters/#query-parameters
版权声明
本文为[Landscape Shepherd]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210619114509.html
边栏推荐
猜你喜欢

云计算中网络基础知识

用JS函数形式实现一个Array.prototype.forEach(),.map(),.filter()

2022牛客寒假补题记录 2

Reflection cannot find the class message classnotfound of UDF when executing flinksql code

C# Winform 关于ListView显示不全问题

【保姆安装教程】Linux操作系统中源码下载MySQL5.7

2020牛客暑期多校训练营第二场 I Interval题解

This site cannot provide a secure connection. An unsupported protocol is used

力扣-322.零钱兑换

力扣-354.俄罗斯套娃信封问题
随机推荐
Database splitting under microservice architecture
【保姆安装教程】Linux操作系统中源码下载MySQL5.7
VMWare vSphere Failed to create object
用MATLAB写一个自动生成福利彩票双色球号码的程序
2021年YCU蓝桥杯程序设计竞赛选拔赛题解
使用zk实现分布式锁原理代码浅析
Implement an array in the form of JS function prototype. forEach(),. map(),. filter()
学习笔记-最长子序列,最大子方块
【LeetCode217】存在重复元素
【LeetCode 19】删除链表的倒数第 N 个结点
【LeetCode 59】螺旋矩阵 II
Analysis of distributed lock principle code using redis
POJ - 2955 Brackets 区间dp
Could not initialize cudnn ,please check cudnn installation.
数据库——《对数据进行排序》
C语言版:二叉树的前序,中序,后序非递归遍历实现
「Tarjan」有向图强连通分量
末日将至(简单计算几何)
pg 数据库不能使用 zh_CN.UTF-8:initdb: error: locale “zh_CN.UTF-8“ requires unsupported encoding “GBK“
【LeetCode 350】两个数组的交集 II