Do you want to allow users to add their favorite post in WordPress? Many users or visitors are likely to click on a button than writing a comment. Adding post ratings, like buttons, or add to favorite button allows you to offer effortless interactions on your site. If you are wondering how you can allow users to add their favorite post in WordPress, you might want to stick with this article.
Allowing users to add favorite posts, helps registered users revisit their favorite posts. It will help you to understand what kind of content users like on or about your site. You can show any new visitors or users what others like the most on your site. You can get them engaged with your most favorite content.
With that being said, today, here at DevotePress, we will be learning the easiest way possible to add favorite posts in WordPress.
Adding Favorite Posts in WordPress
The very first thing you need to do is install and activate the WP Favorite Posts plugin from the WordPress Plugin Directory.
Upon activation, head over to the Settings > WP Favorite Posts to configure plugin settings.
To enable ‘Add to favorite’ option for registered users only, leave ‘Only registered users can favorite’ checked; if you all the visitors to see the ‘Add to favorite’ button, leave it unchecked.
Choose where to show the ‘Add to Favorite’ link. The plugin can automatically show the link Before Post or After Post content. Advanced users can also choose custom method and use <?php wpfp_link() ?> template tag inside WordPress theme files.
Now choose the image icon you want to show next to ‘Add to favorite’ link in ‘Before Link Image’. The plugin comes with a few images that you can use. You can also upload your own image or don’t show any image at all.
Next, choose the number of posts you would like to show on your favorite posts page. The default option is 20. You can change that if you want to.
Lastly, you can enable or disable statistics in ‘Most favorite posts statistics’. Keep it enabled if you want to show most favorite posts in the sidebar widget.
Click on the Update Options button to store your settings.
You can now visit any single post on your website and you will see the Add to Favorite link.
Showing Most Favorited Posts in WordPress
Here is how you would show your most favorited posts in your blog’s sidebar.
Firstly, head over to Appearance > Widgets page. You will notice ‘Most Favorited Posts’ widget. You will need to drag and drop this widget to a sidebar.
Select the number of posts you want to show in the widget. Make sure to click on the Save button to store the progress.
You can now visit your website to see the most favorite posts in your blog’s sidebar.
Showing a User’s Favorite Posts in WordPress
The plugin, WP Favorite Posts stores favorite posts for non-registered users in cookies. For registered users, it saves their favorite posts in your WordPress database.
Here is how you can show each user their favorite posts on your site.
Firstly, head over to Appearance > Widgets page and add ‘Users Favorite Posts’ widget to a sidebar.
You can select the number of posts you want to show in the widget. Make sure to click on the Save button to store the progress.
You can now look at your site.
Reference: WP Beginner