Do you want to add a featured posts section in the sidebar of your WordPress website?


Displaying your top content as featured posts in the sidebar can help you drive more traffic to your pillar articles.


In this article, we’ll show you how to easily display featured posts in WordPress sidebar using multiple methods.


Easily feature posts in WordPress sidebar

为什么要在WordPress侧边栏中添加特色帖子? (Why Add Featured Posts in WordPress Sidebar?)

Sidebars are the non-content area of your website. Most users utilize this space by adding a email newsletter form, social media buttons, and / or displaying banner ads.

侧栏是您网站的非内容区域。 大多数用户通过添加电子邮件通讯表单 ,社交媒体按钮和/或显示横幅广告来利用此空间。

Another way you can utilize the sidebar is by displaying your top articles as featured posts. This helps you get more traffic to those articles, and you users are able to discover your best content without looking for it.

利用侧边栏的另一种方法是将热门文章显示为特色文章。 这可以帮助您吸引更多访问这些文章的流量 ,并且用户无需寻找就可以发现自己的最佳内容。

Here is how we feature our top articles on WPBeginner. This sidebar widget appears on all pages of our website.

这是我们在WPBeginner上精选文章的方式。 此侧边栏小部件将出现在我们网站的所有页面上。

Featured posts WPBeginner

That being said, let’s take a look at how to add featured posts in WordPress sidebar to boost your pageviews and user engagement.


方法1.在WordPress侧边栏中添加帖子 (Method 1. Featuring Posts in WordPress Sidebar)

This method is pretty straight forward and does not require you to install any plugin on your website.


Simply go to Appearance » Widgets page and add a Text widget to your WordPress sidebar.


Featuring posts in WordPress sidebar using a text widget

This widget comes with a visual editor equipped with a few formatting buttons at the top. You can simply add titles of the posts you want to feature as a bulleted list or plain text.

该小部件带有一个视觉编辑器,该编辑器的顶部配有一些格式化按钮。 您可以简单地添加要作为项目符号列表或纯文本显示的帖子标题。

After that, select the post title and then click on the link button to add link to the blog post.


Once you are done, don’t forget to click on the ‘Save’ button to store your changes.


You can now visit your website to see your featured posts in action. This is how it looked on our demo site.

现在,您可以访问您的网站以查看您的精选帖子。 这就是在我们的演示站点上的外观。

Featured posts in WordPress sidebar text widget

方法2.使用菜单在WordPress边栏中的功能发布 (Method 2. Feature Posts in WordPress Sidebar using Menus)

This method is a little indirect but gives you the ability to manage your featured posts more effectively.


Instead of adding the featured post list in a Text widget, we will create a navigation menu and then display it in the sidebar.

我们将创建一个导航菜单 ,然后将其显示在边栏中,而不是在“文本”小部件中添加精选的帖子列表。

The advantage of this method is that you can easily add new posts without editing the widget, and you can reorganize the list with a drag & drop interface.


First, you need to visit the Appearance » Menus page and click on the ‘create a new menu’ link.


Create a new custom menu in WordPress

Next, you need to enter a name for your menu that helps you easily identify it whenever you need to add it somewhere. After that click on the ‘Create Menu’ button to continue.

接下来,您需要为菜单输入一个名称,该名称可以帮助您在需要添加菜单时轻松地进行识别。 之后,单击“创建菜单”按钮继续。

Enter your new menu name

WordPress will now create a new blank menu for you.


Now, you need to click on the ‘Posts’ tab from the left column to expand it. From here you need to select the posts you want to feature. You can find them under Recent, All, or use the search option to locate and select them.

现在,您需要单击左栏中的“帖子”标签以将其展开。 在这里,您需要选择要发布的帖子。 您可以在“最近的”,“全部”下找到它们,或使用搜索选项找到并选择它们。

Select posts you want to feature

After selecting the posts you want to add, click on the ‘Add to Menu’ button. Your posts will now appear in the right column and you can edit each one of their titles by clicking on it. You can also rearrange them by simply dragging them up or down.

选择要添加的帖子后,单击“添加到菜单”按钮。 您的帖子现在将显示在右栏中,您可以通过单击它们来编辑它们的标题。 您也可以通过简单地上下拖动来重新排列它们。

Save your menu

Once you are satisfied, click on the ‘Save Menu’ button to store your changes.


Your menu is now ready to be used.


Adding Featured Posts Menu in Sidebar


Simply go to the Appearance » Widgets page and add the ‘Navigation Menu’ widget to your sidebar.


Add Navigation Menu widget to your sidebar

Next, you need to provide a title for your sidebar menu widget and then select the featured posts menu you created earlier from the dropdown menu.


Don’t forget to click on the Save button to store your widget settings. You can now visit your website to see your featured posts list in action.

不要忘记单击“保存”按钮来存储小部件设置。 现在,您可以访问您的网站以查看特色帖子列表。

Featured posts displayed using navigation menu widget

方法3.使用古腾堡在WordPress中添加特色帖子 (Method 3. Adding Featured Posts in WordPress Using Gutenberg)

A lot of users may want to display their feature posts inside a WordPress post or page. They may be using the page editor to create layouts for their homepage or their theme may not have a sidebar.

很多用户可能希望在WordPress帖子或页面内显示其功能文章。 他们可能正在使用页面编辑器为其主页创建布局,或者其主题可能没有侧边栏。

This method allows you to feature posts in your WordPress posts and pages.


Simply edit a WordPress post or page where you want to showcase your featured posts. On the post edit screen, click on the add new block button (+) at the top and then add the ‘List’ block to your content area.

只需在要显示特色帖子的WordPress帖子或页面上进行编辑即可。 在帖子编辑屏幕上,单击顶部的添加新块按钮(+),然后将“列表”块添加到您的内容区域。

Add list block

Simply add the title of each blog post you want to feature as an item on the list. Then select the text and click on the link button in the toolbar to create a link to the article.

只需在列表中添加每个要发布的博客文章的标题即可。 然后选择文本,然后单击工具栏中的链接按钮以创建文章的链接

Once you are done, you can save your changes and update or publish the post. This is how it looked on our demo website.

完成后,您可以保存更改并更新或发布帖子。 这就是我们的演示网站上的样子。

Reuse The Feature Posts Block


One great feature of the block editor is that you can save block as ‘Reusable block’ and then add the same block in any posts or pages you want.


To make your feature posts block reusable, simply click on the three-dot menu icon in the block toolbar and select ‘Add to reusable blocks’.


Create reusable block

Next, you’ll be asked to provide a name for your reusable block. Give it a name that helps you easily identify it later.

接下来,将要求您提供可重复使用块的名称。 为其命名,以帮助您以后轻松识别它。

Name your reusable block

Click on the Save button to save your reusable block.


Now, whenever you are editing a post or page where you want to display the feature posts again. Simply click on the add new block button and look for your reusable block by typing its name.

现在,每当您要编辑帖子或页面时,您都希望再次显示功能文章。 只需单击添加新块按钮,然后通过键入其名称来查找可重复使用的块。

Adding reusable block

You can also edit reusable blocks and it will automatically get updated everywhere. For more details, see our article on how to add reusable blocks in WordPress.

您还可以编辑可重复使用的块,它将在任何地方自动进行更新。 有关更多详细信息,请参阅有关如何在WordPress中添加可重用块的文章。

方法4:用缩略图在WordPress中显示特色帖子 (Method 4. Display Featured Posts in WordPress with Thumbnails)

A simple plain list of links may often go by unnoticed by your users. Displaying thumbnails with your featured posts would help users notice them more easily.

一个简单的普通链接列表可能经常会被用户忽略。 显示带有特色帖子的缩略图可帮助用户更轻松地注意到它们。

To do that, we’ll be using a plugin to fetch and display a list of our featured posts along with thumbnails.


First, you need to install and activate the Display Posts plugin. For more details, see our step by step guide on how to install a WordPress plugin.

首先,您需要安装并激活Display Posts插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

This plugin allows you to select and display any WordPress posts you want anywhere on your website. It uses shortcodes and allows you to build a custom query using a variety of parameters.

这个插件可以让您选择并显示您想要在网站上的任何WordPress帖子。 它使用简码,并允许您使用各种参数来构建自定义查询

For instance, we’ll be using it to fetch and display the list of your featured posts along with thumbnail and excerpt.


Head over to Appearance » Widgets page and add a ‘Text’ widget to your sidebar. In the text area of the widget, simply add the following shortcode.

转到外观»小部件页面,然后将“文本”小部件添加到侧边栏中。 在窗口小部件的文本区域中,只需添加以下短代码。

[display-posts id="1,1178,1177,1176,1174,1173,1016,1011," image_size="thumbnail" include_excerpt="true" excerpt_length="10"]

Don’t forget to replace the id values to match the IDs of posts that you want to feature.


Tip: See our article on how to locate the post IDs in WordPress.


Now click on the ‘Save’ button to store your widget settings.


You can now visit your website to see it in action. It may not look good out of the box so let’s add some CSS magic to clean it up a little.

现在,您可以访问您的网站以查看其运行情况。 开箱即用的效果可能不太好,所以让我们添加一些CSS魔术来对其进行清理。

Go to the Appearance » Customize page to launch theme customizer. From here click on the Additional CSS tab and you will see a box where you can add your custom CSS.

转到外观»定制页面以启动主题定制器。 从此处单击“其他CSS”选项卡,您将看到一个框,您可以在其中添加自定义CSS。

Custom CSS box

You can now copy and paste the following CSS to the custom CSS box on your website.


ul.display-posts-listing img { 
ul.display-posts-listing li { 

You’ll see live preview of your changes applied on your WordPress blog. Feel free to modify the CSS to meet your requirements.

您将在WordPress博客上看到所做更改的实时预览。 随意修改CSS以满足您的要求。

Once you are done, don’t forget to click on the Publish button at the top to store your custom CSS.


You can now visit your website to see your featured posts with thumbnail and excerpt.


Featured posts with thumbnail and excerpt

We hope this article helped you learn how to easily feature posts in WordPress sidebar. You may also want to see our guide on the best email marketing services and best WordPress SEO plugins to grow your website traffic.

我们希望本文能帮助您学习如何轻松地在WordPress侧边栏中添加帖子。 您可能还想查看有关最佳电子邮件营销服务最佳WordPress SEO插件的指南,以增加您的网站流量。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/beginners-guide/how-to-add-featured-posts-in-wordpress-sidebar/


  • 0
  • 0
  • 0
  • 一键三连
  • 扫一扫,分享海报

评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2021 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页
钱包余额 0