Skip to content

Instantly share code, notes, and snippets.

@williamsba
Created August 15, 2013 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save williamsba/6240607 to your computer and use it in GitHub Desktop.
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
<?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