Created
August 15, 2013 12:53
-
-
Save williamsba/6240607 to your computer and use it in GitHub Desktop.
WordPress plugin to show full RSS post content when a specific query string exists
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 | |
/* | |
Plugin Name: RSS Feed Customizer | |
Plugin URI: http://webdevstudios.com | |
Description: Show full RSS content entries using a query string ( ex: http://example.com/feed/?display=full ) | |
Version: 1.0 | |
Author: THE Brad | |
Author URI: http://webdevstudios.com | |
*/ | |
add_filter( 'the_excerpt_rss', 'get_full_post_content' ); | |
function get_full_post_content( $content ) { | |
if ( isset( $_GET['display'] ) && $_GET['display'] == 'full' ) { | |
//display the entire post | |
echo get_the_content(); | |
}else{ | |
//only display the post excerpt | |
$output = get_the_excerpt(); | |
echo $output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment