Last active
August 29, 2015 14:20
-
-
Save thefuxia/86d6ebcdec3be4d04af8 to your computer and use it in GitHub Desktop.
WordPress Plugin: T5 Short Feed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Short Feed | |
* Plugin URI: https://gist.github.com/toscho/86d6ebcdec3be4d04af8 | |
* Description: Creates a feed with just the excerpt, no matter what you have set for the main feed. Please visit the permalinks page once after activation. The feed is then available at <code>/feed/summary/</code>. Requires PHP 5.3. | |
* Version: 07.05.15 | |
* Required: 4.2 | |
* Author: Thomas Scholz <[email protected]> | |
* Author URI: http://toscho.de | |
* License: MIT | |
* License URI: http://www.opensource.org/licenses/mit-license.php | |
*/ | |
add_action( 'wp_loaded', function() { | |
add_feed( 'summary', function() { | |
add_filter( 'pre_option_rss_use_excerpt', '__return_true' ); | |
require ABSPATH . WPINC . '/feed-rss2.php'; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment