Skip to content

Instantly share code, notes, and snippets.

@jirsbek
Last active August 27, 2021 16:22
Show Gist options
  • Save jirsbek/acbafacae90906e2e43a7db0f31743c9 to your computer and use it in GitHub Desktop.
Save jirsbek/acbafacae90906e2e43a7db0f31743c9 to your computer and use it in GitHub Desktop.
<?php
/**
* Add Param to Show Number of Posts in RSS
*
* Source: https://wordpress.stackexchange.com/questions/4736/get-all-posts-in-rss
*/
add_filter('option_posts_per_rss', 'my_posts_per_rss');
function my_posts_per_rss($option)
{
if (isset($_GET['posts'])) {
return (int) $_GET['posts'] ?: $option;
}
return $option;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment