Skip to content

Instantly share code, notes, and snippets.

<?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'])) {
<?php
/**
* Add RSS Feed Summary Params
*
* Source: https://wordpress.stackexchange.com/a/195197
*/
add_action('rss_tag_pre', function ($tag) {
$summary = filter_input(INPUT_GET, 'summary', FILTER_SANITIZE_STRING);
if ('yes' === $summary)
add_filter('option_rss_use_excerpt', '__return_true');
<?php
/**
* Add Image to RSS
*
* Source: https://wordpress.stackexchange.com/a/292763
* Source: https://gist.github.com/DaveyJake/aa59667cd3ced5809b4d
*/
function remote_file_size($url)
{
$data = get_headers($url, true);