Adds a Popular Posts RSS feed to your WordPress site.
Popular Posts Feed is a WordPress plugin that adds a popular posts feed to your WordPress-powered web site.
- WordPress 5.3 or newer.
- PHP 5.3 or newer.
- WordPress Popular Posts 5.0 or newer.
- Grab the zip file from the latest release page and then follow the manual plugin installation instructions.
- Go to Plugins, find the Popular Posts Feed plugin and click on Activate to enable it.
- Go to Settings > Permalinks and click on Save Changes to flush WordPress' permalinks rules and have it detect the new feed.
- Visit <your domain name>/feed/popular-posts/ using your browser. If everything went OK, you'll be able to see the popular posts feed right away.
- Go to the latest release page and download the attached zip file from the Assets section.
- Deactivate and uninstall your current version of the Popular Posts Feed plugin.
- Manually install the plugin zip file you just downloaded.
- Go to Plugins and activate the Popular Posts Feed plugin.
- Go to Settings > Permalinks and click on Save Changes to flush WordPress' permalinks rules.
The plugin includes various filter hooks that you can use to customize your popular posts RSS feed. Generally speaking though, the one you'll likely want to use is popular_posts_feed_args
.
Hook into popular_posts_feed_args
to:
- Change the number of items displayed in the feed.
- Change the post type (default is
post
). - Have the feed return popular posts from a given taxonomy (
category
,post_tag
, or even a custom taxonomy!) - Change the Time Range (default is most popular posts from the past 7 days).
- Have the feed return popular posts from a given author.
- etcetera.
The popular_posts_feed_args
accepts pretty much the same parameters used by the wpp_get_mostpopular() template tag from the WordPress Popular Posts plugin.
Here's an example:
/**
* Have the WPP feed display the 10 most popular posts
* from category ID 7 from the past 30 days.
*/
function wp3951_my_popular_feed_options( $args ){
$args['range'] = 'last30days';
$args['limit'] = 10;
$args['taxonomy'] = 'category';
$args['term_id'] = 7;
return $args;
}
add_filter('popular_posts_feed_args', 'wp3951_my_popular_feed_options', 10);
For more filter hooks, have a look at the feed.php
file included with the plugin.
- If you have any ideas/suggestions/bug reports, and if there's not an issue filed for it already (see issue tracker), please create an issue so I can keep track of it.
- Developers can send pull requests to suggest fixes / improvements to the source.