[wp-hackers] Custom feeds: Full and summary

"Choan C. Gálvez" choan.galvez at gmail.com
Wed Dec 21 10:53:48 GMT 2005


Roy Schestowitz wrote:
> _____/ On Wed 21 Dec 2005 10:05:32 GMT, [Chetan Kunte] wrote : \_____
>> I'm looking at something like this in theory, when the blog owner
>> provides full post in feed by default:
>>
>> http://somesite.com/?feed=rss2&type=summary
>> http://somesite.com/?feed=rss2&type=full
>>
>> Does such a thing exist natively in WordPress?
>> -- 
> Looking at the latest version,
> 
> ===
> <?php if (get_settings('rss_use_excerpt')) : ?>
>         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
> <?php else : ?>
>         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
>     <?php if ( strlen( $post->post_content ) > 0 ) : ?>
>         <content:encoded><![CDATA[<?php the_content('', 0, '') 
> ?>]]></content:encoded>
>     <?php else : ?>
>         <content:encoded><![CDATA[<?php the_excerpt_rss() 
> ?>]]></content:encoded>
>     <?php endif; ?>
> <?php endif; ?>
> ===
> 
> You  could change the file and save it as rss-excerpt.php. As far as I can
> tell,  you could not (trivially) pass it an argument to bubble through  to
> the  conditional statements. It requires changing the interfaces. It would
> be  nice, I agree. I have about 5 separate files for feeds, which leads to
> fragmentations  and  leaks.  Choice is good nonetheless. 1/3 of  the  sub-
> scribers prefer full text and the rest settle for a one-line excerpt.

Well, inside function `get_settings` the return value is filtered:

	return apply_filters('option_' . $setting, $option);

So the `rss_use_excerpt` value could easily be modified by a plugin.

Regards,
Choan


More information about the wp-hackers mailing list