There are many ways to add featured posts to your WordPress sidebar. Here are a few methods:
Method 1: Using the Text Widget
- Go to Appearance > Widgets in your WordPress dashboard.
- Drag the Text widget into the sidebar where you want to display the featured posts.
- In the text editor, type the following shortcode:
Code snippet
[display-posts]
Use code with caution.
- In the shortcode, you can use the following parameters to customize the list of featured posts:
number
: The number of posts to display.orderby
: The order to sort the posts by. Valid values aredate
,title
,author
,rand
, andcomment_count
.order
: The order to sort the posts in. Valid values areASC
(ascending) andDESC
(descending).
For example, to display the latest 5 posts, you would use the following shortcode:
Code snippet
[display-posts number="5"]
Use code with caution.
- Click Save.
Method 2: Using the Navigation Menu Widget
- Go to Appearance > Widgets in your WordPress dashboard.
- Drag the Navigation Menu widget into the sidebar where you want to display the featured posts.
- In the Menu Name field, enter a name for your featured posts menu.
- Click Create Menu.
- In the Select Menu dropdown, select the Featured Posts menu.
- Click Save.
Method 3: Using a Plugin
There are many plugins that can help you add featured posts to your WordPress sidebar. One popular plugin is Display Posts. To use this plugin, follow these steps:
- Install and activate the Display Posts plugin.
- Go to Appearance > Widgets in your WordPress dashboard.
- Drag the Display Posts widget into the sidebar where you want to display the featured posts.
- In the Title field, enter a title for your featured posts widget.
- In the Number of Posts field, enter the number of posts you want to display.
- In the Order By field, select the order you want to sort the posts by.
- In the Order field, select the order you want to sort the posts in.
- Click Save.
Which method should you use?
The best method for adding featured posts to your WordPress sidebar depends on your needs and preferences. If you don’t need any customization options, the Text Widget method is the easiest way to add featured posts. If you need more customization options, the Navigation Menu Widget or a plugin like Display Posts are better options.