
WordPress 添加媒体
Sticky posts allow you to add 精选文章 in WordPress and display them differently on your site’s homepage. Recently one of our users asked us how they can add sticky posts in category pages. By adding sticky posts on 类别页面 you can display featured posts from that particular category. In this article, you will get to learn how to add sticky posts for categories in WordPress.
即时贴允许您在WordPress中添加精选文章 ,并在网站首页上以不同方式显示它们。 最近,我们的一位用户问我们如何在类别页面中添加粘性帖子。 通过在类别页上添加粘性帖子,您可以显示该特定类别的特色帖子。 在本文中,您将学习如何在WordPress中为类别添加粘性帖子。

First thing you need to do is install and activate 类别置顶帖. There are no special settings page for the plugin. Simply create a new post or edit an existing one, and you will be able to see a new ‘类别粘性’ meta box in the post edit area.
您需要做的第一件事是安装并激活类别置顶帖 。 插件没有特殊设置页面。 只需创建一个新帖子或编辑一个现有的帖子,您就可以在帖子编辑区域中看到一个新的「品类粘性」元框。

接下来,只需选择您希望将此帖子显示为置顶帖子的类别并保存更改即可。
接下来,只需选择您希望此帖子以卡片形式显示的类别并保存更改。
If you want to set another sticky post in that category, then you will have to uncheck category from the earlier sticky post. It is not required for a post to be filed in the same category. For example a post filed in 公告 category, can be made sticky in the 消息 category.
如果要在该类别中设置另一个即时贴,则必须从先前的即时贴中取消选中类别。 无需将帖子归档在同一类别中。 例如,可以将“ 公告”类别中的帖子粘贴在“ 消息”类别中。
每个类别在给定时间只能有一个置顶帖。此外,每个帖子只能针对一个类别进行粘性。
在给定时间每个类别只能有一张卡片。同样,每个帖子只能粘贴到一个类别。
By default the plugin adds a black border on top and bottom of the category sticky post to distinguish it from other posts. You can disable it by checking the 隐藏粘帖边框 checkbox. When this box is not checked the plugin adds a category-sticky class to the category sticky post. You can override this in your child theme’s stylesheet.
默认情况下,插件在类别粘帖的顶部和底部添加黑色边框,以将其与其他帖区分开。 您可以通过选中“ 隐藏卡片边框”复选框来禁用它。 如果未选中此框,则插件会将类别粘性类添加到类别粘性帖子。 您可以在子主题的样式表中覆盖它。
.category-sticky {
border:none;
background-color:#f5f5f5;
}
We hope this article helped you add sticky posts to your WordPress categories. For questions and feedback you can leave us a comment or join us on 推特.
我们希望本文能帮助您将粘性帖子添加到WordPress类别中。 对于问题和反馈,您可以给我们留言或在在推特上加入我们。
翻译自: https://www.wpbeginner.com/plugins/how-to-add-sticky-posts-for-categories-in-wordpress/
WordPress 添加媒体