Recently one of our users asked us if it was possible to add sticky posts to custom post type archives. By default, WordPress has the sticky functionality available for posts, but not for other post types. In this article we will show you how to add sticky posts in WordPress custom post type archives. Before we move forward, you would probably want to learn how to 创建自定义帖子类型 in WordPress.
在自定义帖子类型中添加粘性帖子 （Adding Sticky Posts in Custom Post Types）
First thing you need to do is install and activate the 粘性自定义帖子类型 plugin. After activating the plugin, go to 设置 » 阅读 and scroll down to the section Sticky Custom Post Types. Next, you need to choose the custom post types where you want Stick This option to be enabled.
To achieve this goal, first thing you need is an archive template for your custom post type like this: archive-post-type.php. Learn how to 创建自定义帖子类型存档页面. For example, if you have a custom post type movie-reviews then your archive page template should be archive-movie-reviews.php. If you do not have a template, create one. Simply copy the contents of archive.php in your theme’s directory and paste them into a new file archive-your-post-type.php.